Help required for m...
 
Notifications
Clear all

[Solved] Help required for model railway project

229 Posts
9 Users
12 Reactions
3,645 Views
TFMcCarthy
(@tfmccarthy)
Member
Joined: 2 months ago
Posts: 129
 

@imillard 

Posted by: @imillard

I have another scenario with the staff machines where I need a third machine to perform the same as the other two, ie, can I add another ESP32 in 'parallel" so when a staff is removed/inserted on that machine, the other two lock/unlock.  Is it just a matter of adding the third ESPs MAC address to the original sketches etc?

Can you elaborate on this case? Why does one staff control two sections? This seems to go against the fundamental principle of 1 staff per section. 


   
ReplyQuote
imillard
(@imillard)
Member
Joined: 2 months ago
Posts: 77
Topic starter  

Posted by: @tfmccarthy

Posted by: @imillard

I have another scenario with the staff machines where I need a third machine to perform the same as the other two, ie, can I add another ESP32 in 'parallel" so when a staff is removed/inserted on that machine, the other two lock/unlock.  Is it just a matter of adding the third ESPs MAC address to the original sketches etc?

Can you elaborate on this case? Why does one staff control two sections? This seems to go against the fundamental principle of 1 staff per section. 

@tfmccarthy, FYI @robotbuilder

Hi Tim,

Sorry, I should have provided more information.

In some cases, in the middle of a section of track, there was the need to have an "intermediate" staff machine, where a siding came off the mainline but wasn't fully signalled or controlled.  I'll try and explain below.

image

A train is leaving station A and wants to leave the mainline at location B and proceed onto the branchline.  They would take the staff from machine A (which gives authority to occupy the full section between A and C).  This action locks machines A, B & C.  When they arrive at the branchline junction (B), they would switch tracks for the branchline, still in possession of the staff.  When the train is clear of the mainline and tracks switched to the mainline, the staff would then be returned to machine B (before the train keeps proceeding on the branchline) which resets (unlocks) machines A, B & C again, ready for another train to occupy the full section between A & C.

So, all I want to be able to do is add another board for machine B that performs the same functions as A & C, but with all three talking to each other.

Does that make sense?

Cheers,

Ian

 

 

Ian Millard
Port Macquarie, NSW, Australia
ESP32/Arduino etc novice


   
ReplyQuote
imillard
(@imillard)
Member
Joined: 2 months ago
Posts: 77
Topic starter  

Posted by: @zander

@imillard ESP-NOW is built in to every ESP32, it's part of the core. It's a nice little protocol, very simple and easy to use just not meant for a lot of data but better than LORA datawise.

That is a nice little board, but it's by Waveshare. I have lots of Waveshare products, but beware documentation is often very old and not updated so you need to know what is BS and what isn't.

They do document (see pics) this board. NOTE you select a ESP32S3 Dev module, NOT C3. This is what I mean by having the experience to know what to look for. There is also a second setting pointed out there for USB CDC, the 2nd picture has both settings, 1st and 4th.

The C3 part may give you difficulty, actually the 3 part, did you check the migration document for ESP-NOW and any other libraries you may need? OR just arbitrarily set the esp32 boards back to 2.0.17. I just tried that and the ESP32S3 Dev board entry is still there.

As to if it can do the stuff other than ESP-NOW, I leave that as an exercise for the reader, surely you have advanced at least that far by now, plus you know the requirements, I do not. It's most likely just fine, but check, maybe try one before buying 10 as these will be expensive since they are Waveshare and new.

 

-- attachment is not available --
-- attachment is not available --

@zander

Thanks Ron.  You did post some suggestions on smaller boards earlier in this discussion, but I didn't follow up on that.  One of your suggestions, the Wemos D1 Mini, looks like it would be suitable. I'll do some further investigation.

Cheers,

Ian

 

Ian Millard
Port Macquarie, NSW, Australia
ESP32/Arduino etc novice


   
ReplyQuote
TFMcCarthy
(@tfmccarthy)
Member
Joined: 2 months ago
Posts: 129
 

@imillard 

Posted by: @imillard

A train is leaving station A and wants to leave the mainline at location B and proceed onto the branchline.  They would take the staff from machine A (which gives authority to occupy the full section between A and C).  This action locks machines A, B & C.  When they arrive at the branchline junction (B), they would switch tracks for the branchline, still in possession of the staff.  When the train is clear of the mainline and tracks switched to the mainline, the staff would then be returned to machine B (before the train keeps proceeding on the branchline) which resets (unlocks) machines A, B & C again, ready for another train to occupy the full section between A & C.

I understand now. This allows multiple exits from the protected section to an unprotected section, e.g., stockyard.

So, to answer your question,

Posted by: @imillard

an I add another ESP32 in 'parallel" so when a staff is removed/inserted on that machine, the other two lock/unlock.  Is it just a matter of adding the third ESPs MAC address to the original sketches etc?

yes. you can add an additional ESP32 staff module with a MAC address and send all outgoing messages to them both. You need to keep track of how many ESP's are in the group. The downside is they'll both respond, so you need to change the receive code to handle multiple replies. IIRC, the receive callback gets the MAC address of the sender, so you can match that to the list of MAC addresses in the group.


   
ReplyQuote
Page 16 / 16