Anyone succeeded to install external LEDs on Pixhawk?
On APM we could configure the param Led_mode to a binary value representing which actions turn LEDs on A5 and A6.
Is there an equivalent feature on Pixhawk? Found nothing in the wiki about it.
Thx for any info,
It's not implemented on the PIxhawk (yet). The reason was that we were expecting 3dr would start selling a separate RGB led like is on the Pixhawk board which could be connected through the I2c connector. You can see a video which shows a prototype (attached to an APM2) here. I actually think the external RGB led is better than us re-implementing the APM2 external LEDs on the Pixhawk because the light pattern is a little different between the two.
In any case, it's on the issues list here.
Ok, thx Randy.
I'm new to this APM/Pixhawk environment, but was curious about this led issue and decided to take a look at the source code.
So on NuttX one can find in /source/drivers a rgbled.cpp that apparently communicates on I2C bus both external and internal with external priority at variable PX4_I2C_BUS_LED ADDR that appears to be set to 0x55 for the current led device which is TCA62724FMG.
I believe that an external Led solution, either inherites from this Led driver at the I2C bus, with limited light combinations, or an external led controller can ignore the current led light patterns and messages, and respond to the Mavlink status messages and display the appropriate light patterns to those status of Mavlink.
I believe it would be useful to have external Led patterns for each flight mode, GPS and/or other sensors status, etc.....
As it is now, with the Led controlled by the base OS (Nuttx) and without replacing code at the base OS I don't see how to get the Mavlink messages to the Led controller.
What am I missing ?
So the MAVLink message don't go to the LED controller. It's the AP_Notify library that watches flags set by the main code and then the various other classes in that lib, which are each responsible for a different type of flashing or beeping thing, send out the update the user in whatever way they can.
So, short of messing with the drivers for NuttX the best way way to implement an external Led is still, at his point, a Teensy, or jBoard solution plugged on the telemetry bus?
I've exchanged some emails with the guys at DSRobotics about the feasibility of "adjusting" their LedsGo led controller to be more APM/PixHawk friendly, i.e. responding with their LED programmable patterns to APM/PixHawk events, and they told me they are going to look at it.
I'm still trying to get oriented on the workings of the APM+NuttX implementation, which for a newcomer is "challenging" :)
btw: can you get me some help on this other question? RC Channel settings
Luis, Yes, I think so. If the ledsgo guys want to integrate it further they might want to make the board understand MAVLink (like the jdrones IO board) so that it can listen in on the mode changes, GPS status, etc or they could create an I2C or CAN bus interface and then I (or someone) can write a driver in AC/AP/ArduRover for it. A Serial interface is also possible although we have lots of plans for all the existing serial ports.
They can email me or PM me through diydrones, github, etc if they'd like to discuss.
I sow some code to emulate the Toshiba chip and output on the SPI bus to drive 2801 RGB light strips. Is this potentially going to be integrated in the mainstream code. This would allow easy connection of external status LED including strips
I've never seen this before. That's quite amazing that someone has done that. Is there more explanation somewhere on how it's hitched up?
There is actually an SPI port on the Pixhawk. It's perhaps slightly tricky programming but maybe it's possible to write an interface for this LED strip, perhaps similar to the toshiba led (aka rgbled).
The serial addressed strip LED thing seems to be at a price point where it's cheaper than other ways of generating multi coloured lighting for copters now (>$20 for a 1 meter strip).
It might be time to relook at the idea of code driven from Pixhawk to control these WS2812B based serial RGB strips via a spare digital pin (it doesn't need SPI or I2C).
If the strip was wrapped right around the whole copter main body, the strip could be used to indicate failsafes or be Nav LED's for night flying (or both). The ring of LED's could be lit in four quadrants as classic Nav LED's. Some could strobe White etc as well. The patterns possible are endless...
One feature might be to have the whole strip change colour in flight with respect to the take off position (the RTL point). The LED strip could change colour depending on the copters movement, away, towards, left or right of the take off point. The idea being the for night flight the way to tell which way your pointing is to just yaw until you get the colour you want (say Green for towards you) and push the forward stick till it comes home. Sort of like the 'Simple flight mode' does with the whole copter. It may allow the pilot to venture further away at night than a few fixed colour LED's allow but still fly in Stab or Acro confidently.
Anyway, I'd code this myself if I could, but I can't.
Cool link. I've added it to the github issue.
Yes, a lot of potential, and the minimum amount of wires to do it.
Each individual LED is identical and is a serial I/O device AFAIK from the datasheets. Each reads the commanded data and forwards the following data onward for the next LED in series.
I've purchased a 60 LED strip tonight to try out. I'll driving it with an 8 pin PIC initially as I can only program in PIC Basic (self taught).
If the number of leds around a copter was four or multiples of four, then driving them from Pixhawk as Nav lights could be as simple as a parameter to activate the LED driving pin, and a parameter that specifies the number of leds in the strip (4, 8, 12, 16 etc). Four colours across the four sections become the Nav lights (White front, Blue rear, Green Starboard side, Red Port side). When a failsafe occurs the LEDs can strobe Red or Pink or whatever etc.
Could also be battery warning lights in daytime. Start out Green at full Lipo cell voltage, fade through Yellow to Red at 3.0V per cell.
Wow this is interesting please keep us posted!! About the only advantage left for the Dji phantom is the external lights which give you a lot of useful info even at great distances. I had 16 LED’s on my quad that was great for night flying which I did a lot. I often wished the LED’s could change colors and or flash to give valuable info. It had occurred to me to hack into the 3DR’s external LED and try to solder some multicolored LED’s to the chip but decided it was probably a futile effort as it was so incredibly small for a human hand to do.