Easy Network Config For IoT Devices With RGBeacon

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.

In fact, all three colors of the RGB LED are used to send information to a computer via a webcam. The red channel flashes out a clock signal, the green channel represents the beginning of a byte, and the blue channel flashes to indicate bits that are high. With a little signal processing, a computer running a Javascript app in a web browser can receive information from a microcontroller flashing its LEDs via a webcam.

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

    1. 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.

  1. 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.

    1. [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.

  2. 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

  3. 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.

  4. 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, 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.

    1. 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.

        1. 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

  5. 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).

  6. 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!

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.