Тёмный

JMRI and MQTT with Arduino part 2 - Detecting and sending sensor updates 

Wirenwood Model Railway
Подписаться 2,2 тыс.
Просмотров 1,4 тыс.
50% 1

In this part I'm looking at sensors - how to monitor their state and detect changes, so that only changes in state are published to MQTT.
#modeltrains #modelrailways

Опубликовано:

 

5 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 13   
@JtagSheep
@JtagSheep Год назад
Looking good! The layout is getting better and better with each improvement, MQTT certainly looks a lot more reliable and works better out of the box.
@WirenwoodModelRailway
@WirenwoodModelRailway Год назад
Thank you! It kind of has your footprint all over it - I wouldn't have got on anything like as well as I did with RS485 had it not been for your help with thr shared ground and your reassurance that I wasn't going to burn my house down!
@modelrailroadthegranderoun1873
@modelrailroadthegranderoun1873 7 месяцев назад
Very interesting. Could I get a copy of the full sketch of this JMRI MQTT sensor? Or where to find? I am in the process of going into the MQTT approach. One concern still is how much communication traffic can this MQTT handle compared to the sma028/29 method? And compared to LCC? Any feedback would be considered in my decision which road to take. Thanks for this clear presentation
@WirenwoodModelRailway
@WirenwoodModelRailway 7 месяцев назад
Thank you for the message! Of course - here's the script I was working on - I'm sorry, I thought I'd added a link on the video at the time. github.com/Vintage80sModelRailway/JMRI-MQTT-Arduino I'm afraid that other than RS485 I have nothing to compare MQTT to. All I can say is, unlike RS485, since the day I put MQTT in it hasn't caused me the slightest issue and I'm still using it now. I believe that traffic size is kept to a minimum as it's widely used for remote small devices, but I'm sure there'll be more about that on their website! Regards, Chris
@modelrailroadthegranderoun1873
@modelrailroadthegranderoun1873 7 месяцев назад
thanks a lot. I will have a look to it
@RailyardProductions
@RailyardProductions 6 месяцев назад
As I understand it, MQTT is not really limited in the amount of messages it can send or receive, at least not as far as controlling model railroads goes.
@ovejerof
@ovejerof Год назад
Excelente
@lesharvey2748
@lesharvey2748 Год назад
I have written a program for an esp32 dev board to interface with the rs485 to read the sensors then you can either similar code to the dcc++ program to go to wifi or ethernet or usb back to your JMRI . I send it to iTrains which has a dcc++ex interface . Works well via usb .
@aleopardstail
@aleopardstail Год назад
on the shift registers, possible option is a modified version of your sensor class, that can be passed a pointer to a byte, and a bit number - then on the loop thats what it looks at - with another bit of code running prior to this that reads the byte?
@WirenwoodModelRailway
@WirenwoodModelRailway Год назад
Thanks Dale - I've done something very similar to that - watch this space! Chris
@ianjeffery4773
@ianjeffery4773 Год назад
I think I might have populated the array from a data file rather than hard code it. I'm not that familiar with C++ but if it has collections I would have used that rather than an array. Good work though.
@WirenwoodModelRailway
@WirenwoodModelRailway Год назад
Hey, the Jeffroid! I'm like you, quite unfamiliar with C++. These Arduinos are do short on memory that things like collections, which being a c# developer, I'd love to use, but they just don't seem to be available, I'm stuck with arrays! Even a page with, say some JSON with config in it would necessitate the inclusion of json libraries which would be another hit on the 248k of available RAM! I think I've played Jet Set Willy on computers with more memory than this thing has! Regards, Chris
@anfieldroadlayoutintheloft5204
good vid on channel thanks lee
Далее
НЕ БУДИТЕ КОТЯТ#cat
00:21
Просмотров 958 тыс.
S2 MQTT Broker Installation
30:05
Просмотров 2,3 тыс.
Designing my own automation app for JMRI
21:36
Просмотров 1,3 тыс.
Monitor Room Temperature Remotely with Arduino & MQTT
15:23