Advice on using Ethernet Lan on RPi to communicate with Particle Cloud

Is there anything special required to use a wired LAN internet connection to talk to the Particle Cloud instead of WiFi - or is this just plug and go?

Nothing special is required. Just plug in the Ethernet cable. If you can access the internet from your Pi, the Particle Cloud will be able to connect too.

2 Likes

@jvanier Thanks for confirmation, another question. Are you aware of any out of the box solution to connect a Raspberry Pi GPIO port to photon headers. I am basically trying to make a photon with an ethernet connection instead of wifi that can be plugged into the headers on a PCB designed for the photon. Can I assume that just removing the calls WiFi functions will be all that is required to port photon sketches to the Pi?

Hum, I think you’ll need to make a custom cable between the PCB and Pi. For my personal projects, I use these pre-crimped wires and these terminals.

Last question, could you recommend a way to output to the RPi monitor/screen from the sketch - a graphics library similar Adafruit_ILI9341, etc. Or is this best done by serving HTML to a local IP and using a browser?

A good example of this is the Particle Maker Faire 2017 Great Ball Machine. We built this big contraption last year and used a Raspberry Pi for the display. The UI was in a browser that talked to the firmware through HTTP.

1 Like

@jvanier Thanks, lots to try out here.

@jvanier, having looked at the firmware and website javascript could I test how this appears to me to work?

The firmware (hero.ino) is reading data (inputs) from a CANBus with names/labels the same as the objects in the javascript DOM. These have either integer or float type values. Every 100 mS you open and write to a file /home/pi/can_signals.json with JSON [is this valid JSON? I guess it doesn’t matter] with each pair of data values {"#name":value, …}.

The webserver setup (root directory) and javascript (factory.js) is the bit I am really not so clear on. In the javascript I was expecting to see either JSON.parse() or AJAX/JQuery and $.getJSON()?

How does the website/server update when a new set of data if written in to the can_signals.json file?

I have tried a similar process - currently with a static file using both JSON.parse() and $.getJSON() and neither is working.