dealing with modell railway i would like to control cars,locomotives, roadways with switches by a database and application on pc/laptop,
arduino only to manage hardware, and pc for logical issues
guess : this might be possible !
which way or method : rx/tx-communication or what ?
the cars and roadway and switches should be directly controlled by arduino,
but selection of them and special funcion at a time should be controlled by
application with data from database and this should work bidirectional ,
because status information must go back to database !
so i have to find out whether this could be done wifi - technology or similar,
knowing there are wfi-shields for arduino.
hi,
as i dont have much overview with interfaces between PC and Arduino or ESP..,
just i'm looking to LAN-Shield for Arduino, hope i can manage informations on PC
and control hardware of model-railway with arduino.
have some experience with mySQL and Java / PHP, so the pc seems to be helpful
and have great monitor
Check the link, it gives two way access to an Excel spread sheet on Windows.
An alternative might be to dumb down the PC software a little and to create a database of locomotive movements on an SD card, this is something that the mcu's are quite good at.
Just decide on what you want to translate on the Arduino side. You could send "Toot" from PC to Arduino and have the Arduino board blow the whistle.
Or you could send "toot toot" for two toots.
Or toot could == 2, then you could send the single character "2" to blow the whistle.
Essentially, the Arduino must parse each command, the execute on that serial input translation.
Rough idea of power from a very old rainy day project of mine:
There is a little bit of a complication in how this would all get done. The Arduino must initiate the communication with the PC by sending a message that it is ready for the next instruction. Then the PC can decide what to send and when to send it. When the pc sends the next instruction to the Arduino, the Arduino will execute the command and send back to the PC that it is ready for the next command.
The ready command from the Arduino can also send any status information necessary.
This "protocol" can be expanded to allow the Arduino to send other status messages to the PC.
as a bit of protocol : the arduino will get one or more commands from pc
and has to collect them as a joblist as long as the are fullfilled
but on a railway flow its possible, that not all jobs could fullfilled ..
this status is to send back to pc
the app on pc has to decide what to do , i.e. to stop arduino doing anything in a worse case..
the database has to check the singularity of trains and roadways and warants, that all pairs and roadways are complete !
no train may be lost (thats what happened by human error on real systems !)
thats my philosophy of the railway-system : no train may belost, it allways remains in system
independent of human mind !
i worked with labview 20 years ago on job, but this software has a different goal..
with a relational database one can do more with data
than excel or other spreadsheets or most measuring software tools : ..i.e.warant the singularity of data (even of dupels)
and building dependancy controlled information pools !
This seems so obvious that I wonder if I'm missing the point of the question. But an Arduino comes with a serial port, and you can use that to communicate with a PC. If a human user can see output from the Arduino on a monitor, and send input to it that way, then a computer could do the same. Write your code on the PC, have it tell the Arduino what to do and make the Arduino tell the computer what the current status of the hardware is. It should be possible to control a large and busy system within the time allowed by messages over the serial port.
Do you know about the Model Electronic Railway Group? If you joined (you do have to pay!) then you could discuss this kind of project. https://www.merg.org.uk/
I do. Create your tables in SQL, Access or whatever and export them to Excel. Labview can read the Excel files and transfer that information to the Arduino.
Have the Arduino interpret this information as actions. You can control as many actions as you want with a large bank of shift registers.
Getting realtime status back to the database application to perform realtime adjustments would be a different matter