Ethernet frame communication

Posted on
  • Could network enabled Espruino devices communicate using Ethernet frames?

    I ask as I've been using some MQTT style code written atop a Go Ethernet Frames library on Raspberry Pi. The broadcast option means you can achieve something very like MQTT pub/sub, but without data ever leaving your network and/or the need for a broker to relay via ( I always rely on the free insecure ones)

    It's worked well on a couple of projects I've done, so, I'm now wondering could I get Raspberry Pi talking to Espruino over same protocol?

  • I reckon UDP broadcast should be doable - it's just a matter of adding it to the WIZnet firmware. I'd have thought that could actually do what you want and it's supported on ESP8266 (and I think ESP32?) at the moment.

    However it's hardly pub/sub - since everyone gets everything?

    Are Ethernet Frames even lower level than UDP though? I think realistically your best option would be to use something like the ENC28J60 - modules with them on were pretty cheap last time I looked, and they expose Ethernet at the packet level anyway, so it should be pretty easy to fire off packets however you want.

  • From what I've gathered frames are lower level than UDP. And yes it's nothing like real pub/sub, the client basically filters the frames based on a list of subscriptions it holds in memory and discards everything else.

    Just checked out that module - I wouldn't have the first idea what to do with that :) so I think I'll look further at your suggestion on UDP. Thanks @Gordon.

  • @Ollie what is the use-case? Performance or privacy/security?

    If it is privacy then it is very easy to run mosquitto orĀ­aster/example.js (pure node.js MQTT server) on your raspberry.

    If it is the broker requirement itself it looks like implementing CoAP might be the way?

    Going under UDP/TCP would require support from all the specific SDKs of all the boards which seems a no-go.

  • Thanks @opichals I'd come to that conclusion re the SDK.

    Re use-case - honestly? It started out as a learning exercise, but I've found it to be very useful and reliable. Re performance, I don't have any benchmarks, my apps are sending at 50ms intervals with no problems, but I appreciate that's not particularly fast when compared to MQTT QoS 0 which I think is the best comparison. That's not to say the interval can't be much smaller. I haven't tried.

    I could run Mosquitto locally, and may end up doing, but this has fewer moving parts to achieve (or at least emulate) the same thing. That was the attraction really.

    I'll look into CoAP though since I've no experience with that. Thanks again.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview

Ethernet frame communication

Posted by Avatar for Ollie @Ollie