Go Back   EcoModder Forum > EcoModding > Instrumentation > OpenGauge / MPGuino FE computer
Register Now
 Register Now
 

Reply  Post New Thread
 
Submit Tools LinkBack Thread Tools
Old 01-20-2017, 01:10 PM   #61 (permalink)
deviant
 
Join Date: Oct 2016
Location: Seattle, WA
Posts: 69

s2k - '02 Honda s2000
Thanks: 12
Thanked 47 Times in 35 Posts
Quote:
Originally Posted by skybolt View Post
If I can eliminate deployment issues by duplicating your process, I can turn my attention to setting the correct flags, testing, further development, etc.
Never mind, these steps seem to work:

1. Name file simple name like main.cpp
2. Save blank .ino as project from Arduino UI
3. Copy main.cpp to project folder.
4. Compile and enjoy! Any issues with compiling are flags, environment, etc. In other words, not implementation errors.

  Reply With Quote
Alt Today
Popular topics

Other popular topics in this forum...

   
Old 01-20-2017, 01:17 PM   #62 (permalink)
EcoModding Apprentice
 
Join Date: Dec 2012
Location: Portugal
Posts: 197
Thanks: 93
Thanked 70 Times in 64 Posts
Hi Skybolt

Quote:
Originally Posted by skybolt View Post
tVago:

Are you using the standard Arduino UI to compile? If so, what's your standard process for adding a new sketch? I've just downloaded 20170116_194. Since it's a cpp file, I can either rename it .ino, or make a blank .ino and add the new code as main.cpp (or other name).

Problem is, it won't compile - sometimes it's my fault, but sometimes it's an issue with filename, since the arduino UI treats .cpp, .c and .ino files differently at compile time. If I can eliminate deployment issues by duplicating your process, I can turn my attention to setting the correct flags, testing, further development, etc.
See the process here. https://youtu.be/XLfNDOeNIw4

Thanks
José Rodrigues
  Reply With Quote
The Following User Says Thank You to josemapiro For This Useful Post:
t vago (01-20-2017)
Old 01-20-2017, 01:20 PM   #63 (permalink)
MPGuino Supporter
 
t vago's Avatar
 
Join Date: Oct 2010
Location: Hungary
Posts: 1,807

iNXS - '10 Opel Zafira 111 Anniversary

Suzi - '02 Suzuki Swift GL
Thanks: 828
Thanked 708 Times in 456 Posts
Quote:
Originally Posted by skybolt View Post
tVago:

Are you using the standard Arduino UI to compile? If so, what's your standard process for adding a new sketch? I've just downloaded 20170116_194. Since it's a cpp file, I can either rename it .ino, or make a blank .ino and add the new code as main.cpp (or other name).
I use my text editor, TextPad, to edit the code itself. It does a very good job of formatting the code for ease of understanding.

When I want to compile the code, I just open up an Arduino IDE session, select the board, serial port, and programmer (if needed), paste the code into the IDE editor window, then upload the code into my test / production platform. The IDE does not do much of anything beyond that for me.

Quote:
Originally Posted by skybolt View Post
Never mind, these steps seem to work:

1. Name file simple name like main.cpp
2. Save blank .ino as project from Arduino UI
3. Copy main.cpp to project folder.
4. Compile and enjoy! Any issues with compiling are flags, environment, etc. In other words, not implementation errors.
Yah, something like that.

Last edited by t vago; 01-20-2017 at 01:22 PM.. Reason: saw updated post from skybolt
  Reply With Quote
Old 01-20-2017, 02:12 PM   #64 (permalink)
deviant
 
Join Date: Oct 2016
Location: Seattle, WA
Posts: 69

s2k - '02 Honda s2000
Thanks: 12
Thanked 47 Times in 35 Posts
Minor bugs

Trying to deploy 20170116 to ATMega with Parallax LCD. Display beeping madly. In setting bit rate to 384 and 96, found the following:
Line 434. What used to read:

Code:
#ifndef useSerialLCD
#undef useLCDserialPort0
#undef useLCDserialPort1
#undef useBufferedLCDserialPort
#endif
Now reads:
Code:
#ifndef useSerialLCD
#undef useLCDserialPort0
#undef useLCDserialPort1
#endif
This might be good code or depends on operator setting buffered correctly.

Can't set any Refill digits to 0. Examples:

Set to 1. Reset to 0, "parameter unchanged," stays at 1.
After 1, set to 9. Parameter saved as 10.
Set to 15. Try and set to 5. "parameter unchanged," stays at 15.
After 15, set to 10. Parameter saved as 25.
  Reply With Quote
The Following User Says Thank You to skybolt For This Useful Post:
t vago (01-20-2017)
Old 01-20-2017, 02:32 PM   #65 (permalink)
deviant
 
Join Date: Oct 2016
Location: Seattle, WA
Posts: 69

s2k - '02 Honda s2000
Thanks: 12
Thanked 47 Times in 35 Posts
Can't do JSON output on 0; compile error:

Code:
sketch/main.cpp: In function 'void pushSerial0Character(uint8_t)':
main.cpp:5895: error: expected primary-expression before ')' token
  while ((UCSR0A & ) == 0); // wait until USART0 data buffer is empty
                   ^
exit status 1
expected primary-expression before ')' token
Trying to debug as best I can (or set correct parameters if I've set them incorrectly to generate this error.

JSON output on serial1 does not generate this error.
  Reply With Quote
The Following User Says Thank You to skybolt For This Useful Post:
t vago (01-20-2017)
Old 01-20-2017, 03:59 PM   #66 (permalink)
MPGuino Supporter
 
t vago's Avatar
 
Join Date: Oct 2010
Location: Hungary
Posts: 1,807

iNXS - '10 Opel Zafira 111 Anniversary

Suzi - '02 Suzuki Swift GL
Thanks: 828
Thanked 708 Times in 456 Posts
Quote:
Originally Posted by skybolt View Post
Trying to deploy 20170116 to ATMega with Parallax LCD. Display beeping madly. In setting bit rate to 384 and 96, found the following:
Line 434. What used to read:

Code:
#ifndef useSerialLCD
#undef useLCDserialPort0
#undef useLCDserialPort1
#undef useBufferedLCDserialPort
#endif
Now reads:
Code:
#ifndef useSerialLCD
#undef useLCDserialPort0
#undef useLCDserialPort1
#endif
This might be good code or depends on operator setting buffered correctly.
Sounds like the Parallax LCD is getting wrong data. If you're setting the Parallax LCD baud rate to 9600 baud, it helps to press in on the el cheapo DIP switches on the back of the Parallax LCD module as you apply power to it. Otherwise, the only acceptable baudrates for the Parallax display are 2400, 9600, and 19200.

As for the other #undef that no longer appears, that's intentional. I realized that a buffered LCD is a buffered LCD, regardless of whether it goes through the serial port or through the legacy 4-bit interface. Since there are different mutually exclusive #defines for either LCD device, I saw no point in also making a distinction between a buffered serial LCD and a buffered legacy 4-bit LCD display.

Quote:
Originally Posted by skybolt View Post
Can't set any Refill digits to 0. Examples:

Set to 1. Reset to 0, "parameter unchanged," stays at 1.
After 1, set to 9. Parameter saved as 10.
Set to 15. Try and set to 5. "parameter unchanged," stays at 15.
After 15, set to 10. Parameter saved as 25.
It's supposed to do that. Every time somebody enters some value to the Partial Refill stored parameter, that value actually gets added to the stored parameter. It was meant for people who liked to continually do partial refills.

The Partial Refill menu includes an option to set the Partial Refill stored parameter back to zero. Alternately, choosing the Tank Trip Reset option from the Partial Refill menu, also resets this stored parameter back to zero.

As a safety feature, long button presses are assigned to those functions that cause something to be reset, even under a sub-menu. So, when you go to reset the partial fill amount, you have to hold down the button in order to reset it.

Quote:
Originally Posted by skybolt View Post
Can't do JSON output on 0; compile error:

Code:
sketch/main.cpp: In function 'void pushSerial0Character(uint8_t)':
main.cpp:5895: error: expected primary-expression before ')' token
  while ((UCSR0A & ) == 0); // wait until USART0 data buffer is empty
                   ^
exit status 1
expected primary-expression before ')' token
Trying to debug as best I can (or set correct parameters if I've set them incorrectly to generate this error.

JSON output on serial1 does not generate this error.

Oooops, forgot about that - I apparently forgot to include a bit value in that above expression.

Try this:

Code:
	while ((UCSR0A & (1 << UDRE0)) == 0); // wait until USART0 data buffer is empty

Last edited by t vago; 01-21-2017 at 12:47 AM.. Reason: clarification
  Reply With Quote
The Following User Says Thank You to t vago For This Useful Post:
skybolt (01-21-2017)
Old 01-21-2017, 04:57 PM   #67 (permalink)
deviant
 
Join Date: Oct 2016
Location: Seattle, WA
Posts: 69

s2k - '02 Honda s2000
Thanks: 12
Thanked 47 Times in 35 Posts
Output bug

I cannot generate any serial output on Arduino Mini or Pro Mini, and cannot generate serial output on Arduino/Genuine Arduino. Same settings on ArduinoMega or Mega2560 work fine. Using serial port zero for output on all attempts. Tested Mega2560 using LegacyLCD, output was fine.

Serial output worked on November build, after a delay (10? 15? 30 seconds) or after jiggling wires.

Is there a flag to disable going to the settings screen on first boot? Or, alternatively, does it time out? I searched your input or setup routines but couldn't see where it was being invoked on first boot.
  Reply With Quote
The Following User Says Thank You to skybolt For This Useful Post:
t vago (01-21-2017)
Old 01-21-2017, 10:33 PM   #68 (permalink)
MPGuino Supporter
 
t vago's Avatar
 
Join Date: Oct 2010
Location: Hungary
Posts: 1,807

iNXS - '10 Opel Zafira 111 Anniversary

Suzi - '02 Suzuki Swift GL
Thanks: 828
Thanked 708 Times in 456 Posts
Quote:
Originally Posted by skybolt View Post
I cannot generate any serial output on Arduino Mini or Pro Mini, and cannot generate serial output on Arduino/Genuine Arduino. Same settings on ArduinoMega or Mega2560 work fine. Using serial port zero for output on all attempts. Tested Mega2560 using LegacyLCD, output was fine.
Can you turn off buffered serial output for port 0 and try again?

I cannot really do any more troubleshooting right now, as my Arduino Uno is currently installed in my Magnum, doing duty as a transmission computer. I will have to order a few Unos from Amazon and wait for them to get here. Sorry about that.

Quote:
Originally Posted by skybolt View Post
Serial output worked on November build, after a delay (10? 15? 30 seconds) or after jiggling wires.
That's.... weird. I had a bit of frustration, too, trying to get debug serial output working back in December, but I can't remember exactly what I ended up doing to get it to work. I think I sent an introduction string as the very first transmitted string.

Quote:
Originally Posted by skybolt View Post
Is there a flag to disable going to the settings screen on first boot? Or, alternatively, does it time out? I searched your input or setup routines but couldn't see where it was being invoked on first boot.
There's not really a flag, as such. The code checks for the presence of a signature word in EEPROM, when it first starts after power-on. If the signature word does not exist (like if you reprogram with a ICSP programmer, and the ICSP programmer also helpfully erases your EEPROM for you, for instance), then the code writes a set of default stored parameters, then tells itself to start off with the settings screen.

I will tell you how to disable the going to the setting screen, but I will not incorporate it into the code. Go to about line 11831, and change this line from this:
Code:
	if (loadParams() != 1) doGoSettingsEdit(); // go through the initialization screen
to this:
Code:
	loadParams();
It will preserve the EEPROM signature checking, but will not force you to go to the settings screen if you happen to power up with a blank EEPROM.
  Reply With Quote
The Following User Says Thank You to t vago For This Useful Post:
skybolt (01-25-2017)
Old 01-25-2017, 10:58 PM   #69 (permalink)
MPGuino Supporter
 
t vago's Avatar
 
Join Date: Oct 2010
Location: Hungary
Posts: 1,807

iNXS - '10 Opel Zafira 111 Anniversary

Suzi - '02 Suzuki Swift GL
Thanks: 828
Thanked 708 Times in 456 Posts
Quote:
Originally Posted by skybolt View Post
I cannot generate any serial output on Arduino Mini or Pro Mini, and cannot generate serial output on Arduino/Genuine Arduino. Same settings on ArduinoMega or Mega2560 work fine. Using serial port zero for output on all attempts. Tested Mega2560 using LegacyLCD, output was fine.
I am not able to duplicate this problem.

Got my new Arduino Uno in the mail today, and tried both the 20170116 release and my latest code. Both code versions worked just fine. I did have to remember to change the serial 0 speed down to 19200 for the Serial LCD function, but other than that, it worked as expected. I am running it now with Legacy LCD and JSON output on the serial 0 port, and it's happily running now in debug mode.

Which reminds me: The only other thing I can think of is that the code turns off JSON output if there are no injector or VSS pulses detected. Should the code have JSON output turned on even if there is no VSS pulse or injector pulse detected?
  Reply With Quote
Old 01-29-2017, 02:14 PM   #70 (permalink)
deviant
 
Join Date: Oct 2016
Location: Seattle, WA
Posts: 69

s2k - '02 Honda s2000
Thanks: 12
Thanked 47 Times in 35 Posts
Quote:
Originally Posted by t vago View Post
I am not able to duplicate this problem.
This appears to have been an intermittent (!) issue associated with my USB-C to mini-to-FTDI adapter. It is now functioning as expected.

Quote:
Should the code have JSON output turned on even if there is no VSS pulse or injector pulse detected?
I assume you are not referring to sleep mode after not detecting speed/inj pushes for a set time? I can work around sleep with a periodic reset or extending the timeout period. If, on the other hand you leave it on all the time, and suppress output to save energy, then that would cause problems. How much energy is saved when suppressing output?

I can see the logic in not wanting to send output when there is nothing to send, and it is elegant, but it also seems to be a solution in search of a problem.

I have a work item to be tackled later -- setup over JSON. That would require constant output, but of course that could be addressed by
Code:
(if SETUP) {send_output;}
In other news, SUCCESS!! I now have a working arduino pro mini (3.3v, 8MHz) working, attached to a raspi shield containing all car-to-arduino circuits and arduino-to-pi pins. It's a bit ugly, but it works, and so I can now do in-car testing with the new code base and pi output. I've noticed the most recent JSON output isn't formatted correctly, I'll start working on that.

NOTE: I will post specifics later, but using VNC on the pi and my phone's hotspot allows me to project the 2nd pi (with the new code) to my phone, so I can view new and old back-to-back. I will post which pi-based VNC server I'm using -- which if you go this route you will want, as it a) projects the console, if desired; b) uses native authentication making it both slightly less insecure and easy to use, and c) works flawlessly with the official vnc clients.

Attached Thumbnails
Click image for larger version

Name:	IMG_0198.JPG
Views:	56
Size:	168.1 KB
ID:	21252  
  Reply With Quote
The Following User Says Thank You to skybolt For This Useful Post:
t vago (01-29-2017)
Reply  Post New Thread


Tags
graphics, json, video

Thread Tools




Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Content Relevant URLs by vBSEO 3.5.2
All content copyright EcoModder.com