ESP8266 Port and Networking

Hello,

most parts of my RIOT-OS port to the ESP8266 has been implemented. GPIO, SPI, I2C, UART, PWM seem to be ready and most of local applications are working.

However, RIOT-OS makes no real sense without networking. Unfortunately, ESP8266 doesn't have Zigbee or 802.15.4 radio interface on board.

Sure, one possibility would be to connect a Zigbee module via SPI. But, it doesn't seem to be reasonable to connect a 25 EUR Zigbee module to a 3 EUR MCU which has a WiFi interface on board.

Therefore, my question is, what is the best way to realize networking on a new platform that doesn't have 802.15.4 radio but full TCP/IP stack and WiFi on board?

Any suggestion helps.

Regards Gunar

Hi Gunar,

Do you have any links to your work ?

Since I do also work on the ESP8266 I can only say that being able to send and receive UDP packets might be a place to start?

I’m not a RIOT expert - so that’s where I stand.

If RIOT supports Sockets or MQTT that might also be worth looking into.

Regards

David

Hello.

Hello,

most parts of my RIOT-OS port to the ESP8266 has been implemented. GPIO, SPI, I2C, UART, PWM seem to be ready and most of local applications are working.

However, RIOT-OS makes no real sense without networking. Unfortunately, ESP8266 doesn't have Zigbee or 802.15.4 radio interface on board.

Sure, one possibility would be to connect a Zigbee module via SPI. But, it doesn't seem to be reasonable to connect a 25 EUR Zigbee module to a 3 EUR MCU which has a WiFi interface on board.

A 15.4 module via SPI will be way cheaper than 25 EUR. One could find the Microchip MRF24J40MA for something like 7 EUR in Germany. https://de.rs-online.com/web/p/products/6665748/?grossPrice=Y&cm_mmc=DE-PLA--google--PLA_DE_DE_Halbleiter-_-Hf-_Und_Mikrowellenschaltungen&mkwid=s_dc%7cpcrid%7c94257843919%7cpkw%7c%7cpmt%7c%7cprd%7c6665748&gclid=EAIaIQobChMI2Mz9sLiJ2gIVhLftCh3GNAVKEAQYAyABEgJMpPD_BwE&gclsrc=aw.ds

If you want the lowest price for any module looking at Aliexpress might also be an option.

Which route you wanted to go for networking is up to you, but I wanted at least point out that there are way cheaper options to the 25 EUR you quoted.

regards Stefan Schmidt

Hi Gunar, David,

I think implementing against the sock API make most sense:

http://riot-os.org/api/group__net__sock.html

Have a look at this PR which intends to port the ESP as an AT-based network device:

https://github.com/RIOT-OS/RIOT/pull/5898

Best Peter

https://github.com/RIOT-OS/RIOT/pull/5898

The AT firmware is not really fit for purpose for this task although it might on the surface seem that way.

Much time and frustration would be saved implementing the same thing via the Lua firmware - nodemcu. For example, use LUA to do a real ‘AT’ interface as the AT firmware that comes on most boards is disappointing.

Also, there is a C SDK available for the ESP8266 and I was interpreting the conversation to mean that a RIOT interface would be utilising that. That would be a fairly involved project and I think the OS is based on RTOS or something so that may be less attractive.

Regards

David

Hi David, Peter,

many thanks for your answers. I was already thinking about using MQTT on top of UDP which shouldn't be a problem to implement. My question was a bit different.

GNRC is the core element of networking. It uses devices via the Network interface API on top of layer 2, e.g., IEEE 802.15.4 radio.

Therefore, I was wondering whether there is something like a tunneling approach where 802.15.4 packets are encapsulated in UDP packets and decapsulated by 802.15.4 gateway nodes so that WiFi based nodes could become part of the meshed network without having a MQTT broker. I could not find enough information whether ZigBee Encapsulation Protocol could do that job.

@David: Even though I have a fork of RIOT-OS at https://github.com/gschorcht/RIOT-Xtensa-ESP8266, it is only used at the moment to document the current status of the port. There are a lot of things to tune before it is suitable for the public.

At the moment the port can be used on top of Espressif's Non-OS SDK or as bare metal implementation without the SDK. The later one is small and fast. However, it is probably a dead end in case you want to use the WiFi interface. Since it is completely proprietary, there is no other option than to use the SDK :frowning:

I hope that I can publish the first version next week, probably without networking.

Regards Gunar

Hi,

Therefore, my question is, what is the best way to realize networking on a new platform that doesn't have 802.15.4 radio but full TCP/IP stack and WiFi on board?

I suggest implementing netdev on top of the WiFi layer 2 of the ESP, treating it as ethernet.

In the beginning you could use the esp API to configure the WiFi (SSID, pwd, ...), down the line there should be netdev get/set options for that.

Going this route, you can use the esp's wifi, ignore its integrated IP stack and make all RIOT networking features work. It would allow other RIOT applications to be easily ported.

Cheers, Kaspar