External Light Bar

I wonder if anyone could assist me. I am using an arduino nano and WS2812B string. All works fine but then lEDs get stuck all on - the arduino seems to freeze. I thought this might be a power issue so am using a 5v supply. I also have experimented using different number of led - from 19 to 59 but no difference. I am using the latest @woody_matt Aog 5.5 and ino files.

@Oliverp44 Are you using USB or UDP? I have got the USB version with 31 LEDs running with the simulator on my bench now - an hour in and no issues.
Is there a particular scenario when the system seems to freeze? e.g. during a u turn when the LEDs are changing a lot? After a set amount of time?

*Edit:
I have now got to the point where it has frozen. Ag diag is still showing the correct values being sent, so I am investigating whether the serial buffer is overflowing.

Using usb. I cannot seem to pinpoint when it occurs but seems to be when all green led lit. When in the field I did keep losing my gps (ardusimple) which I did not before so assumed power. Now I am using external power that has not happened again.

Just seen the frozen message - that is exactly as I experience

The Serial buffer was eventually filling up and the new messages were just being discarded. I have hopefully sorted it - please may you give this .ino a try and let me know how you get on? AutosteerPCBv2LB/Autosteer_USB_v5_0.ino at AOG-5.5_bugfix · MattWoodhead/AutosteerPCBv2LB · GitHub

thank you - After a short while it now again seems to freeze but only with the centre LED lit. the ag diag still shows correct messages. The timescale for the freeze has not changed and might be as short as 1 minute, rarely much longer.

I did some further testing using different number of LED but the issue continued. The only other thing to add was rather than freeze with all LED on it froze with simply the single middle LED on.

When it freezes with just the middle LED, is it purple/pink coloured? If so, the new .ino is doing that to indicate that it is not receiving the data from AgIO (either due to no connection, failure of the PC to send the message, or the serial buffer on the Nano is getting full. Does it persist or does it recover itself after a period of time? If you open AgDiag (see gears menu in AgIO) is the lightbar message still updating as you move?

There is some code on lines 839 to 843 that you can uncomment that will illuminate the onboard led of the arduino if the serial buffer starts to get full. Please can you uncomment them and see if the led is illuminated when you reach the freeze condition?

//    if (Serial.available() > 55){  // check for the Serial buffer contents
//      digitalWrite(LED_BUILTIN, HIGH);  // Pin 13 LED indicates buffer is getting too full
//    } else {
//      digitalWrite(LED_BUILTIN, LOW);
//    }

So tested again with that section uncommented.
The agio continues to send data even after the freeze
The usb connection remains fine
The on led on the arduino stays on and the rx led continues to blink.
No other leds light up when it freezes on arduino.

If I set the number of LEDs to 19 I have yet to get it to freeze.
If I set the number of leds to 25 or above it is fine at very slow speed but when I go faster than about 5kph it freezes.

When it freezes the led is purple / pink.

I am not sure what led to look for on the nano so see if the buffer is full.

I am using an Arduino Nano [A000005]

Been working on a few changes to some lightbar projects to add or improve WiFi capability. Also replaced cabled ethernet in MechanicTony’s Dual_Basic with Wifi. The repo’s are public in case someone might find them useful.

In my setup, I use a Toughpad which also acts as a WiFi AP. It shares out a USB tether from my phone for NTRIP data. This makes the entire setup only need power to each device and eliminate a lot of wiring in the cab. Also makes placement of the components more flexible.

I am looking at using hologram.io for data since my Toughpad has a builtin cellular card. Hologram is pretty cheap IoT access. The platform fee is $0.70 per SIM per month ($8.40/yr) and data is $0.08 per MB. A typical day of use in field for me is about 500 KB so it might be worth it to eliminate another cable.

The M5StickCplus is a neat solution to creating a light bar. It is $22 on Mouser and a meter of self-stick weatherproof LED’s is $14. Makes for a nice plug and play lightbar setup. In addition to the lightbar, it also displays the CM deviation from the track on the LCD display.

Some of these projects were ported from Arduino IDE to VSCode. I like Arduino IDE but VSCode / PlatformIO provided direct integration with Github and easier inclusion of external libraries. The “squiggles” feature is really nice since it highlights errors before even trying to compile. It saved me a bunch of time. Also, VSC makes it easy to “clean” the pre-compiled cache. This was very helpful when tracking down and issue with the WiFi code.

3 Likes

Added EasyEDA archive of the Basic_Dual_WiFi board in the Basic_Dual_WiFi repo. If anyone wants to order one from your favorite PCB maker. I used jlcpcb.com and the results were quite good.