Hi guys,
I would like to ask for an advice. Basically what I want to do is RPI local server with web server, where I can display data from arduino sensors and from web page (web server) I need to be able send values to arduino (like temperature… arduino will manage everything else). The connection should be serial (usb) as I don’t want to use any shields.
I tried to use Home Assistant, but in the end I couldn’t pass data from web to arduino. Second one, which I tried was Blynk… but I couldn’t even connect the arduino to the RPI…
Yes and from web interface I want to send some values (such as temperature, which user set on web interface) to Arduino so I can manage the heat. I don’t want to manage it in RPI.
I know that MQTT would be a solution, but I can’t use it. I need it over the USB/Serial.
Will I be able to this simple communication just from serial USB connection? Do you have some experience with mysensors.org? I’m kinda lost on their website…
It looks like they’re aiming for standalone Arduino projects.
In general what mysensors does is having a central gateway and wireless sensors. They use mainly NRF24 for communication. This is low power and I have a lot of those at home. Some run on batteries for more than one year already.
But all gateways need to be connected to a controller. And in my case this is OpenHab. I opted for MQTT but had it serial before.
So to answer your question: I had over quite a period an Arduino Uno connected via USB to my Raspi where OH is deployed. Over time I had added a lot of sensors and the serial connection was a heck to administer. If you only connect one Arduino with serial, this should be simple.
On their site, go to https://www.mysensors.org/controller/openhab
instructions are there.
But again, we do not know anything about your usecase. potentially you let us know and we can provide potentially a better option.
From my point of view, this is ok for one or two sensors but if you start, you will adding more and more sensors over time and therefore some sort of wireless will be better.
What I’m basically trying to to is Raspberry Pi server to which I connect arduino as controller. Arduino will have just few sensors…about 3 and it will controll some based on values which arduino process (arduino will handle processes and conditions). On the RPI I want to host web server where I will see current values which I’m receiving from sensors (like room’s temperature) and also I want to be able to send 1 or 2 values of data to arduino (just pass the number {int} through the usb and arduino will handle everything alone).
For this scenario, I think openhab, even a Raspi is overhead. This can be achieved with a simple ESP8266. All on one microcontroller. If you need it a bit more „fancy“ go for ESP32.
Webinterface runs directly on the device, no need to interface etc.
I would suggest you use the relay sketch from mysensors to start with. Instead of connecting a relay, connect a LED. Then in OH implement it as a switch, if you succeed, you can turn the LED on and off via OH web interface.
If you like, you could even download the IOS or Android app to control it via smartphone
My understanding then is that you want an Arduino to be connected directly to your PI, using a USB serial connection. The Arduino will have some sensors, and you want to receive the sensor values on the PI to be able to display these in the Web server (i.e. on the openHAB UI). Furthermore, you want to be able to set some values (e.g. a setpoint) on the UI and have these values sent to the Arduino. Correct?
In this case, I suggest you take a look at the Serial binding:
I have not used it myself, but from the documentation it looks like you should be able to cover your use case with this binding.
After 1.5 years > what are the experiences with this method?
Did anyone try to plug in multiple Arduino boards (NANO) into a single RPi to control them all with OH?
Can those boards handle the I2C attached other (GPIO) extender boards too, to forward from / to the master?
How fast can it be?
default 56 Kbaud seems to be very slow to inform OH about everything in “realtime” if I long-press a button from 40-60 total + read some analog values too (distance, dust, temp…)
… except if ONLY CHANGES travel through the bus?
Also I don’t like the idea of serial com without proper flow control + parity bits. (Bad expeiences during the last 20 years…)
Is the USB>Serial way the better, or Ethernet + Moscuito?
How about Firmata?
Maybe UDP?
Thanks in forward for any info about this. (The documentations and possibilities are overwhelming to choose the right way…)
I’m using Modbus Binding, my PLC is a bridge: Modbus over RS485 to Modbus over Ethernet, but you can use any Modbus converter or instead of RS485 you can use the arduino ethernet module.
How many IO ports + other all together on how many stains/busses?
im using it for sensors there are 5 arduinos, but i can’t see any problem to add more
Exactly what kind of devices?
What do you mean?
What firmware is uploaded to the Ardu boards?
There in no such a thing like firmware in arduino. Sketches are written in C/C++ like language
Is the Arduino ONLY a gateway, or can you use the IO + Analog ports on it too?
Every arduino is a Modbus Slave and you have acces to all goods on board
What speed is it working? Can you long-press / dimmering / double click?
115200, all stuff like short/long/double etc. clicks, you can handle by arduino.