When you’re hooking up hardware to a network, it can sometimes be a pain to figure out what IP address the device has ended up with. [Bas Pijls] often saw this problem occurring in the classroom, and set about creating a simple method for small devices to communicate their IP address and other data with a minimum of fuss.
[Bas] specifically wanted a way to do this without adding a display to the hardware, as this would add a lot of complexity and expense to simple IoT devices. Instead, RGBeacon was created, wherin a microcontroller flashes out network information with the aid of a single RGB WS2812B LED.
It’s a neat hack that should make setting up devices in [Bas]’s classes much easier. It needn’t be limited to network info, either; the code could be repurposed to let a microcontroller flash out other messages, too. It’s not dissimilar from the old Timex Datalink watches which used monitor flashes to communicate!
25 thoughts on “Easy Network Config For IoT Devices With RGBeacon”
Three color channels?! Back in my day just one color was enough and we couldn’t see it because it was infrared.
And sure it was done with a 555!
Given that a lot of IoT boards have a monochrome LED tied to a GPIO, a monochrome protocol would certainly be appropriate and shouldn’t be hard to implement and would remove the need for a tri-color LED.
You can use 3 “color” channel with infrared too: 850nm 900nm 940nm.
It’s still infrared, but why easy when we can make it complex, right.
A smartphone decoding app would be very useful.
Then you’d better use morse. There are plenty of decoders both for Android and Iphone.
If a smartphone is available, just scan the network and you get all the pis in it.
It already works on Android because the browser based decoder works in mobile Chrome
hmm, assuming you’re using wifi capable microcontrollers, just syslog the information of to a server on the internet and you could use qr stickers on the devices which give back this information (and more) when you scan those with your smartphone.
[sarcasm]And you can also trigger the printing of a small label on the server so it can be attached to a pigeon and sent to you ASAP. And pigeon as tasty as well so you can recycle it for your next diner.[/sarcasm]
Honestly, a solution that works without fuss is always better than anything else. I’ve seen audio transmission for some of the IOT I’ve used and it somehow worked well, using the buzzer of the gizmo. Using light can also work if this proves efficient. I’ve seen many implementation of coding a bit stream on light either visible or not and in both direction. Even some iot allow sending the configuration by flashing the smartphone LCD’s backlight.
While your solution is interesting in itself, OP’s solution is more elegant and consume less (network access is a waste of electrical resource when uneeded)
Wouldn’t it be simpler with a self clocked signal such as some kind of manchester coding in this case ?
This could be done with a single color led that’s usually built in most mcu dev boards
E.g. something in the IrDA suite of protocols: https://en.wikipedia.org/wiki/Infrared_Data_Association?wprov=sfla1
But really, getting any reasonable data rate from a webcam looking at a single point source of light is impressive, so kudos to OP
It would be simpler to scan the network with an app, but that would be too easy and not fun.
I recall that cars used to be able to flash out diagnostic error codes using a single lamp on the dashboard. No need for RGB or any other device than your eyes.
and maybe your brain?
I wrote a simpler version of this. Most of the time you will already know the network address ( ie 192.168.0.xxx) so all we really need is the last octet. I split that into the three digits using mod operator then flash each number through a different color led. Say the ip was 192.168.0.123, Red would flash once, Green would then flash twice and finally Blue would flash three times. Simple to code and easy to read without computer assistance.
I was thinking right along with your idea except also including the thought from the previous comment about older cars flashing codes. With a short pause between digits and a set of quick flashes at the end of the octet to signal “finished”, only one LED could be used.
So here’s a thought: To transmit an octet one would only need to signal 8 bits. Morse it in 8 short or long flashes perhaps?
But if all we want to do is to visually tell the octet, it could just blink the led the same number of times as the each number in the octet with a long blink for a 0. So for 205, it would blink twice, then 1 long blink followed by 5 blinks.
If you work with binary enough, you could just blink 8 times, short for 1 and long for 0 (or vice versa), and after 8 blinks you have the octet without having to refer to a chart/table/formula to convert from binary to decimal
For a classroom, the easiest solution is to use a DHCP reservation tied to the mac address. Now the IP address is pre-determined. You could also use IPv6 where the address is directly related to the mac address.
Another thought is that if you are going to put in code to flash an LED to a computer, you could have just put in code to send a ping to the computer over the network (which would include the source IP address).
This is so cool! Very technical, and thanks for sharing!
Morse code, wifi, ZigBee, Bluetooth, infra-red, lora, sigfox, 2g-5g, UART, SPI, I2c, i2s, CAN, old school modems, PCI, pci-e… Voice, flags, sonar, tin cans and string,. All known or established ways to communicate.
Well done for doing something a bit different! Kudos for your ingenuity!
I love the RGB solution — clock, data, framing. Perfect fit, minimal protocol. Very cute.
Now how to get the info in the other direction? Color sensors?
Please be kind and respectful to help make the comments section excellent. (Comment Policy)