Тёмный

Using RFID over MQTT to help track trains around a model railway layout 

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

I've been tinkering with RFID for a long time but could never seem to get it working. The penny finally dropped and I found that it's going to be a useful tool in improving the use of my DCC throttle and cab signals project.
Links (I don't have any affiliate links)
The library I lifted some code from for tag processing github.com/johannrichard/Seee...
The cheap reader www.ebay.co.uk/itm/2644671882...
Seeed reader www.ebay.co.uk/itm/3870263964...
Code - this is a link to the repo I use to back up all of the code for my 'live nodes' - I've put a bit of documentation in there too github.com/Vintage80sModelRai...
#modelrailway #modeltrains

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

 

24 июн 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 43   
@jjcrom4280
@jjcrom4280 11 дней назад
Another informative video. Thank you for documenting what you do.
@WirenwoodModelRailway
@WirenwoodModelRailway 10 дней назад
Thanks Justin, I appreciate you taking the time! Regards, Chris
@OOElectronics
@OOElectronics 9 дней назад
Very interesting video. Thanks for posting.
@John-uu6jc
@John-uu6jc 7 дней назад
Get a life
@WirenwoodModelRailway
@WirenwoodModelRailway 7 дней назад
Thank you! And thanks for taking the time to leave a message. Regards, Chris
@davidharris7249
@davidharris7249 12 дней назад
Great video, thanks. Nice boost for you to discover JMRI tracks the trains!
@WirenwoodModelRailway
@WirenwoodModelRailway 12 дней назад
Thank you and yeah, I love pleasant surprises like that !Already got my head down working what I can do with it! Regards, Chris
@DonningtonCastleModelRailway
@DonningtonCastleModelRailway 11 дней назад
This is really cool, thanks for sharing everything. Looks like I have another excuse to delay track laying … fitting a reader on each line so I can try this out later in the build.
@DonningtonCastleModelRailway
@DonningtonCastleModelRailway 11 дней назад
One question, have you tried those tags on stock with a metal chassis? I know there are specific tags for fixing on metal surfaces but just wondered if you’ve had any issues with it, or issues with there being live rails between the reader and tag?
@WirenwoodModelRailway
@WirenwoodModelRailway 11 дней назад
Hi Martyn - thank you! And good question - I immediately scuttled up there to do a bit of a test and confirm that metal can interfere with the reading. My initial, very scientific test was to slap a tag on the back of one of those wallpaper scraper type tools and stick a few strong magnets to it for good measure - and no response. I then too the motor car from the class 43 and it looks like I'm getting nothing from a tag stuck to the bottom of that - even though the Class 40, Class 158 and Class 370s all had metal chassis too. This isn't a major issue for me as I can just stick a tag to the first coach, which is almost entirely plastic. But it may affect others who intend to use RFID in a different way. And yes, good idea to get the readers down before too much track / track detail goes on. I would have done that on mine but thought I'd never get RFID working so never got around to it! Then I got it working and wished I'd put the sensors down earlier. Regards, Chris
@DonningtonCastleModelRailway
@DonningtonCastleModelRailway 10 дней назад
@@WirenwoodModelRailway thanks for doing some testing, very useful to know. After watching the video I did some rummaging as in the past we’ve built lots of RFID learning puzzles. In the stores I found some NTAG203s that are designed for metal and we’ve used successfully (massive overkill for this application). But these are 13.56MHz tags rather than 125Khz. Did you do much research on which frequency is best for this use case, I’m guessing low frequency is probably better? I’m just wondering if I can re-use existing kit or should just go down the route you took.
@WirenwoodModelRailway
@WirenwoodModelRailway 10 дней назад
Hi Martyn - caveat here is I haven't tried any of this - but it looks like those 13.56MHz devices use SPI for communication which complicates things a little for me as, on the Arduinos, I've got ethernet devices plugged into the SPI ports. It did look possible to have multiple SPI devices connected at once but it looks like a bit of a cabling and code faff so I thought I'd go for the simple life (especially as it took me ages to get that working anyway!) and use the relatively simpler serial 125khz devices. So my advice would be make sure you're comfortable with the whole process, from reading, to processing, to sending to JMRI or whatever, before you invest. Think about how many readers you might need, where they'll be placed and what the conduit will be (Arduino over ethernet, ESP32 over wifi etc) to get those tags to their ultimate destination - I think I saw you using JMRI in a recent video so I'll assume that's what you're using. Hope that helps - get in touch if you want to chat some more about it. Regards, Chris
@DonningtonCastleModelRailway
@DonningtonCastleModelRailway 6 дней назад
@@WirenwoodModelRailway that’s really good advice, thanks. I think I’ll take a step back and do a little testing with the kit that’s sat on the shelf. I have some code that allows me to talk to the high frequency readers using python, so I can use that for testing. That might allow all comms over USB, with the data then being dumped into MQTT if the hardware works reliably. But as you suggest I won’t make any choices till I’ve got stuck in and understand things a bit better. Thanks!
@deeprunrailroad_Mike
@deeprunrailroad_Mike 12 дней назад
Yet another thing I need to try. Thanks for the post and the effort to make the video. Isn't model railroading fun. Mike
@WirenwoodModelRailway
@WirenwoodModelRailway 12 дней назад
Ha, it really is! Thank you! Chris
@ClinchfieldModelRailroad
@ClinchfieldModelRailroad 11 дней назад
That 4 wire connector is for a Grove port. I bought a 16 port Arduino type board from Seeed Studio to connect these to a PC usb.
@WirenwoodModelRailway
@WirenwoodModelRailway 10 дней назад
Ah thank you that solved a mystery! I guess that would work - I hope there are extension cables available though or all your readers are going to be very close together! Regards, Chris
@anfieldroadlayoutintheloft5204
@anfieldroadlayoutintheloft5204 12 дней назад
very interesting, vid on channel keep up the vid layout is looking good thanks four the update vid you do on channel
@WirenwoodModelRailway
@WirenwoodModelRailway 12 дней назад
Thanks Lee!
@rudolfabelin383
@rudolfabelin383 7 дней назад
Super! Really inspiring. The devil is in the details!
@WirenwoodModelRailway
@WirenwoodModelRailway 6 дней назад
Thank you Rudolf! Regards, Chris
@ClinchfieldModelRailroad
@ClinchfieldModelRailroad 12 дней назад
Yes, it might be convenient to see a RGB led above each throttle knob to see the status of each loco.
@WirenwoodModelRailway
@WirenwoodModelRailway 12 дней назад
Absolutely - having signal status sent to the box and being displayed for the trains that each throttle is driving is definitely interesting me! The challenge to get around to start with is there are absolutely no spare pins on the ESP driving it! Regards, Chris
@little_britain
@little_britain 11 дней назад
This is a great and useful instructional video. One question: doesn't JMRI already know where our locos are (because they're DCC with unique IDs)? I can see the use of this for consists (other rolling stock) like McKinley does.
@WirenwoodModelRailway
@WirenwoodModelRailway 11 дней назад
Good morning - and thank you! I'm afraid not - in the sense of controlling trains, DCC is very much a one-way protocol. The Command Station generates the digital instructions that are sent out to the decoders but nothing is sent the other way. I think maybe RailCom does something in terms of feedback but I've never used it. Regards, Chris
@ClinchfieldModelRailroad
@ClinchfieldModelRailroad 11 дней назад
These might work great with a M5StickC plus. Just bring 5v bus.
@WirenwoodModelRailway
@WirenwoodModelRailway 10 дней назад
Thanks I've just Googled them as I'd never heard of them - they look interesting! I'mnot sure what extra they'd bring though?! Thanks! Chris
@jimrobinson6362
@jimrobinson6362 6 дней назад
Layour 23' x 8' on 2 levels keeping track with eyeball mark 1 and baby monitor cctv - simples
@WirenwoodModelRailway
@WirenwoodModelRailway 5 дней назад
Thanks for sharing how you like to operate your layout! Regards, Chris
@aleopardstail
@aleopardstail 12 дней назад
very interesting, and timely experimenting with RFID here, though using the higher frequency tags because it makes life more difficult.. you may find the issue with tags on the underside of locos causes issues if the thing has a metal chassis, the tags don't work as well with metal behind them, a bit of spacing helps. the high frequency tags can be programmed with user data (e.g. stick a decoder address into the tag itself, avoids look ups), also use SPI not the serial port, didn't want to use serial due to the lower speed, also I want the interrupt stuff which the library doesn't yet support so likely writing my own that gibberish aside in terms of placement I'm thinking (not yet installed, nor is the track, or even half the board) on having a reader when a train enters or leaves a hidden section - useful for say turning lights on and off. the technology is interesting, lots of experimentation coming up, and there is a hell of a lot you can do with this - e.g. tracking individual vehicles and "doing something" with that data - my plan is to know what a train is and have a semi intelligent storage yard manager that knows what can fit where for example using RFID to identify the loco and vehicles its dragging. for mounting them I'm using a foam and then cork track bed, its reasonably simple to cut that away and have a thin sheet of plastic under the track covering the gaps
@WirenwoodModelRailway
@WirenwoodModelRailway 12 дней назад
Hi! That sounds interesting but I think the issue I'd have is that the ethernet connectors I have use the SPI interface so the devices wouldn't have a way of communicating the tags received back to JMRI / MQTT. You do have me thinking about what I'd program the tags with though! Regards, Chris
@aleopardstail
@aleopardstail 12 дней назад
@@WirenwoodModelRailway gone with an over-engineered solution here for the RFID, one reader - one ESP8266 controller.. keeps the SPI wires short and talks directly over MQTT. also means they are portable for testing and connect to the layout with just a power and ground wire. See! part of a layout can be "just two wires"...
@WirenwoodModelRailway
@WirenwoodModelRailway 12 дней назад
@@aleopardstail I like it, good idea! Just two wires, wow. I think these days it's only the wires propping the baseboards up on this layout. If I took them out the whole thing would collapse into a dusty heap on the floor! Regards, Chris
@ianjeffery4773
@ianjeffery4773 12 дней назад
I think I'd like to use it more for tracking goods so I can do something like, "Hey, that factory needs more goods, send it a train." Also, you could use it to determine when trains need sent for fuel/depot service. Knob box, snigger...
@WirenwoodModelRailway
@WirenwoodModelRailway 12 дней назад
Hey Jeff! And yeah, sniggering here too. I realised when I was doing this actually that different people will want different things from RFID, which is interesting in itself! Chris
@HHExpress
@HHExpress 11 дней назад
Very Intersting stuff, I was thinking of using it as well but I'm running N scale and have not found a suitable RFID tag for it should be smaller then 10mm
@WirenwoodModelRailway
@WirenwoodModelRailway 11 дней назад
Hmm, yeah, good luck with that! I hope you find something, it must be out there! Regards, Chris
@henrybest4057
@henrybest4057 12 дней назад
Can you please give a link for the tags you use?
@WirenwoodModelRailway
@WirenwoodModelRailway 12 дней назад
I'm afraid it's not that easy at the moment, Henry, they seem in short supply! I'm trying out a new supplier, if they send what I've ordered I'll come back with a link. But you want to be searching for 125khz EM4100. Regards, Chris
@modelrailwaytheeasyway9743
@modelrailwaytheeasyway9743 12 дней назад
I am very interested in having a go at this, thanks for sharing and look forward to having a go if you share the code.
@WirenwoodModelRailway
@WirenwoodModelRailway 12 дней назад
Hi - thank you! The code is shared in the description - I've shared a repo that contains the code for all of my layout nodes - specifically, the ones containing RFID code are github.com/Vintage80sModelRailway/Nodes-for-JMRI/tree/main/MQTT_Client_PS_Node_2 - this is the one I use in the video, and two others github.com/Vintage80sModelRailway/Nodes-for-JMRI/tree/main/MQTT_Client_PS_C1_minimised github.com/Vintage80sModelRailway/Nodes-for-JMRI/tree/main/MQTT_Client_PS_Node_3_minimised Get going and good luck! Regards, Chris
@modelrailwaytheeasyway9743
@modelrailwaytheeasyway9743 12 дней назад
@@WirenwoodModelRailway Thanks Chris sorry I did not spot the links in the description. Love what you have been doing. Regards John
@WirenwoodModelRailway
@WirenwoodModelRailway 12 дней назад
@@modelrailwaytheeasyway9743 Thanks John, that's very kind, and no need to apologise, it was a bit of a breadcrumb trail to the code! Regards, Chris
Далее
LAYOUT LANDSCAPING at Chadwick Model Railway | 229.
33:48
The Most Impressive Basketball Moments!
00:36
Просмотров 13 млн
What I DON'T like about N Scale
5:37
Просмотров 130 тыс.
I 3D Printed a $1,224 Chair
23:56
Просмотров 205 тыс.
Custom Keyboard From Scratch Part 2
17:13
Просмотров 32 тыс.
Building a long,  quick, easy station platform
16:37
Просмотров 3 тыс.