SlotForum banner
61 - 80 of 86 Posts
@Slingshotx So your log is showing the board sending really odd data. If you search for:
SerialConnection [COM3] -- DEBUG1: ***Serial data received:

In the log you'll see what I mean, but here are some examples. What I've put in bold wasn't sent from the sketch code and appears to have some kind of meaning to it.

-----------------------------------
09/22/2024 09:01:33.867 AM:SerialConnection [COM3] -- DEBUG1: ***Serial data received: 65 74 73 20 4A 75 6C 20 32 39 20 32 30 31 39 20 31 32 3A 32 31 3A 34 36 D A D A 72 73 74 3A -- 'ets Jul 29 2019 12:21:46
-----------------------------------
rst:'
09/22/2024 09:01:33.869 AM:SerialConnection [COM3] -- DEBUG1: ***Serial data received: 30 78 38 20 28 54 47 31 57 44 54 5F 53 59 53 5F 52 45 53 45 54 29 2C 62 6F 6F 74 3A 30 78 31 33 -- '0x8 (TG1WDT_SYS_RESET),boot:0x13'

What's crash is that the version message the sketch sends to the PC is clearly in there (56 is definately the V version message and I think 54 is the T timing message):
09/22/2024 09:01:34.011 AM:SerialConnection [COM3] -- DEBUG1: ***Serial data received: 56 1 0 0 D 3B 54 0 0 0 7 0 3B -- 'V
;T;'

So the sketch can send data to the PC...
 
@BigBadBuzz Your log isn't as "good". RC is trying to talk to your board on COM8 but it never received any data at all. Did you say it worked when you enabled WITH_SERIAL_DEBUG in the sketch and you send it the "RESET;" command? Did you remember comment "WITH_SERIAL_DEBUG" back out and re-flash the board?
 
Discussion starter · #63 ·
Yes, when I use the Serial Monitor in the Arduino IDE and WITH_SERIAL_DEBUG enabled, it responds to a RESET; command. I did check that I had disabled WITH_SERIAL_DEBUG and reflashed before connecting to RC. Also, I do see the R4 reset when I go into the RC Arduino setup screen because the little LED array display goes blank for a second or two then shows again (I have the sketch show “RC” on the LED array using a little added code in the init(). So it appears the R4 can receive data from RC but doesn’t send. I’m puzzled - I’ll try looking on the net to see if there are issues / differences with R4 serial comms.

BBB
 
@BigBadBuzz Your log isn't as "good". RC is trying to talk to your board on COM8 but it never received any data at all. Did you say it worked when you enabled WITH_SERIAL_DEBUG in the sketch and you send it the "RESET;" command? Did you remember comment "WITH_SERIAL_DEBUG" back out and re-flash the board?
@Slingshotx So your log is showing the board sending really odd data. If you search for:
SerialConnection [COM3] -- DEBUG1: ***Serial data received:

In the log you'll see what I mean, but here are some examples. What I've put in bold wasn't sent from the sketch code and appears to have some kind of meaning to it.

-----------------------------------
09/22/2024 09:01:33.867 AM:SerialConnection [COM3] -- DEBUG1: ***Serial data received: 65 74 73 20 4A 75 6C 20 32 39 20 32 30 31 39 20 31 32 3A 32 31 3A 34 36 D A D A 72 73 74 3A -- 'ets Jul 29 2019 12:21:46
-----------------------------------
rst:'
09/22/2024 09:01:33.869 AM:SerialConnection [COM3] -- DEBUG1: ***Serial data received: 30 78 38 20 28 54 47 31 57 44 54 5F 53 59 53 5F 52 45 53 45 54 29 2C 62 6F 6F 74 3A 30 78 31 33 -- '0x8 (TG1WDT_SYS_RESET),boot:0x13'

What's crash is that the version message the sketch sends to the PC is clearly in there (56 is definately the V version message and I think 54 is the T timing message):
09/22/2024 09:01:34.011 AM:SerialConnection [COM3] -- DEBUG1: ***Serial data received: 56 1 0 0 D 3B 54 0 0 0 7 0 3B -- 'V
;T;'

So the sketch can send data to the PC...
Thanks @Race Coordinator all fixed reset was caused by having a pin defined in RC configuration that shouldn't be used.

Anyway for anyone that wants it updated sketch, and a brief readme is available here


It should simply detect it's an ESP32 board and just work
 
Discussion starter · #66 ·
I tried a simple PC terminal emulator called 'Termite' connected to the UNO R4. I confirm that I had to turn on DTR / DSR under Flow Control before I would see any data coming from the R4.

When I connected an UNO R3, it didn't need any handshake to send data to the term window.

BBB
 
Any clue if the R3 will worth with DTR enabled? Is what Slingshot got working good enough or is that something different? Sorry, I'm really out of the loop on the R4.

For what it's worth, I was planning on trying to fix the digital fuel code once I get my test track routed (I need to lay the rail and build some bridge supports so it's close but my time is really limited). I could also do some of this testing/work at that point.
 
Discussion starter · #70 ·
@Race Coordinator -
A routed track - that sounds way cool.

Using the same simple PC terminal emulator ('Termite') connected to the UNO R3, the R3 sends data to the terminal whether DTR / DSR is enabled or turned off (i.e., no flow control).

At this point I'm stuck - not connecting to RC has me "dead in the water".

Just to try to close another portion of the R4 investigation, I've ordered a UNO R4 Minima. The hardware serial connections between the UNO R4's RA4M1 CPU and USB port are different in the Minima and WiFi. FYI, R4's have USB-C connectors. The WiFi can switch between the CPU and an intermediate chip (ESP32-S3),

Image



whereas in the Minima the CPU's USB_DP / _DM pins connect directly to the USB-C connector.

Image


BBB
 
Is this what you're saying you need turned on? Or are you saying it is on but doesn't seem to help? I don't set the flag when I open the connection and I don't know what the default value is...

From post #70:

"Using the same simple PC terminal emulator ('Termite') connected to the UNO R3, the R3 sends data to the terminal whether DTR / DSR is enabled or turned off (i.e., no flow control)."
 
Discussion starter · #72 ·
I believe the DTR flag needs to be set when RC opens the connection to an UNO R4. As best as I can tell, setting the flag would not affect the UNO R3. I haven’t checked the Mega 2560 Rev3, but I assume it would behave just like the UNO R3.
 
Discussion starter · #73 ·
The UNO R4 Minima I ordered came in today. I uploaded a slightly modified version of the sketch I have been using (I just removed the R4 WIFI-specific LED matrix code), Unfortunately, the results in trying to communicate with RC are the same -- RC is not receiving anything from the Arduino.
 
Discussion starter · #77 ·
Dave:

Thanks for sending RC beta 1.15.2.99. I finished my testing of the "combined" sketch file (attached). The bottom line is that the combined sketch file adds support for esp32 and Arduino UNO R4 WiFi. I could not get the UNO R4 Minima to work. Here are a few "highlights":
  • The combined sketch file is based on your sketch v1.0.0.13; it supports the Arduino UNO R3, Arduino Mega 2560, Arduino UNO R4 WiFi and esp32 (with option for the esp32 Bluetooth).
  • Arduino UNO R3, Arduino UNO R4 WiFi, and esp32 DevKitC V4 boards were tested and passed. I'm assuming the Arduino Mega 2560 still works, but I didn't test it. I tried several things to try to get the UNO R4 Minima to work, but failed to do so.
  • @Slingshotx added a new function to send RC the sketch version - it looks like he does that rather that actually resetting the esp32 on a reset request. It's the same code that was in the sketch before, just made into a function.
  • More involved conditional compile "trees" to handle all the additional board options.
  • As @Slingshotx pointed out on the forum, there is no need to have a #include for the board type - that will be handled automagically by the Arduino IDE (very cool). The #ifdef's in the code use the board names assigned by the Arduino IDE.
  • The UNO R4 WiFi code displays "RC" on the little LED matrix - just a quick check to know that the RC sketch has been uploaded.
  • UNO R4 WiFi seems to be the only working board that needs the DTR change you put in RC beta 1.15.2.99; the others don't seem to care.
  • FastLED library v3.7.8 and the Arduino_LED_Matrix library included in UNO R4 board package v1.2.1 have a sequencing dependency -- the #include statement for 'Arduino_LED_Matrix.h' must occur before '<FastLED.h>'; otherwise, there will be verify/compile errors.
  • On the esp32, in general the RGB LEDs work; but when configured as Race State LEDs, would not flash / alternate when showing the yellow and checkered flags. This definitely worked with the Arduinos.
  • Just a reminder that RC beta 1.15.2.99 came with sketch v1.0.0.14, so a merge will need to be done if you decide to use the attached sketch code.
Regards,
BBB
 

Attachments

Hi BigBadBuzz,

I have downloaded and tried to compile your sketch for Arduino Uno R4 WiFi, it comes up with the following error, any ideas what might be causing it?
Looks like I might be missing a graphics driver?
Using Arduino IDE 2.3.4 if that helps.

I did read the above but it is all gibberish to me, Would you mind explaining in single syllables.

C:\Program Files (x86)\Race Coordinator\data\arduino\lapCounter\lapCounter.ino:81:11: fatal error: ArduinoGraphics.h: No such file or directory
#include "ArduinoGraphics.h"
^~~~~~~~~~~~~~~~~~~
compilation terminated.
exit status 1

Compilation error: ArduinoGraphics.h: No such file or directory




Thank so much.
 
Discussion starter · #80 ·
ZeGas:

The ArduinoGraphics.h and Arduino_LED_Matrix.h library files are only used to display "RC" on the UNO R4 WiFi's little LED matrix - it doesn't do anything functional. You'll need to load the two libraries. You can do the first one by using the Arduino IDE's Library Manager:

Image


Click on the "stack of books" on the left side of the IDE to bring up the Library Manager. Then type in ardunographics in the search box - it should show you that version 1.1.3 is available, and instead of the REMOVE it shows for my setup, it should show INSTALL for you. Click on that to install the library.

To install Arduino_LED_Matrix.h, go to the Board Manager on the left side of the Arduino IDE (the Board Manager icon is the one above the Library Manager icon on the left side of the IDE window) and type UNO R4 WiFi in the search box. The UNO R4 board package v 1.3.2 should appear - click on INSTALL.

Image


Hopefully once you've done this the sketch will compile. Let me know what happens.

Regards,
BBB
 
61 - 80 of 86 Posts