Code

Forum about the OS-Railway project available on Thingiverse. Here you can ask questions, look at building pictures, share ideas, pictures and STL's.
Hodorious
Posts: 4
Joined: Wed Sep 30, 2020 8:21 am

Code

Postby Hodorious » Mon Nov 23, 2020 9:09 am

hi!
Just finished assemply the freight train.
Where do you find the arduino code?

admin
Site Admin
Posts: 409
Joined: Thu Jan 11, 2018 7:46 pm

Re: Code

Postby admin » Wed Nov 25, 2020 2:40 pm

hi!

Which locomotive is it you are building? There are two versions of codes published. The first was published around the time of the Z70 locomotive and was a very simple stand-alone system based on a stock Arduino board and a button to start/stop the train together with a knob to set the speed.

Since then I've moved on to use a NodeMCU board with wifi-capability which all newer trains use. This is also programmed through the Arduino IDE and the code is available for download on the Hectorrail 141 page:
https://www.thingiverse.com/thing:2575667 (the .ino file)

This remote control is compatible with that code:
https://www.thingiverse.com/thing:3252986

But you can use any web/wifi-capable device such as a mobile phone, tablet or laptop to control the train from.

Hodorious
Posts: 4
Joined: Wed Sep 30, 2020 8:21 am

Re: Code

Postby Hodorious » Fri Nov 27, 2020 7:42 am

Hi! Thanks for answering!

Im building the freight train. I used the code for the Hectorrail.
The issue im currently having is uploading the code from arduino.
Every time i try to upload i get this error message: esptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header

admin
Site Admin
Posts: 409
Joined: Thu Jan 11, 2018 7:46 pm

Re: Code

Postby admin » Sat Nov 28, 2020 12:16 am

ok, that sounds strange.

I would recommend that you start by following a simple get-started tutorial like this one:
https://www.youtube.com/watch?v=flLMMHCNkQE

And make sure that you can follow along there first, and when that is working you can try to upload my code.

erikped
Posts: 1
Joined: Sun Nov 22, 2020 1:23 am

Re: Code

Postby erikped » Sat Dec 19, 2020 3:40 pm

I wanted to share something I found online that works great with the esp8266 in my train. I downloaded an IOT development kit called Blynk. It seems to be free for hobby use. I was able to make a smartphone control panel in minutes. I am not sure how crazy I am about the fact that it uses a server in the cloud to make the connection, but it is very simple. The project you put on the esp8266 is just the example application with your token and wifi info. I do not yet know if it can control multiple micros from the same project as I just tried it out for the first time this morning.


Who is online

Users browsing this forum: No registered users and 1 guest