PI4 DCC++EX

sidney Jul 23, 2023

  1. sidney

    sidney TrainBoard Member

    1,249
    2,122
    38
    Ok im not sure i even want to open this back up... but here we go...
    for long time now i have tried and tried and tried to get PI4 and steves dcc++ex image to work for a LONG TIME...
    having no success i threw everything in the junk box(almost trash can ). as posted in the whats on your work bench i started this dang thing back up. NO SUCCESS again....
    Ok now i dug it out and thought ill try raspberry os and then install JMRI ya right that was a flippin joke...
    i had it working and of coarse its dead again....back to the box it went . ok so i come home and im all relaxed now from those ordeals. I dig the dammed thing back out. (at this point why do i even try ) ok enough...
    MY setup is PI4 dccex installed on sd card .........
    Arduino mega with deeks motor shield and wifi shield (thats the only way i can play with my trains)
    10 inch PI4 monitor. 12 volts 3 amps power....
    #1 cant get on JMRI through PI4 with hand throttles....
    #2 when i do get a train running as soon as the track shorts out all locos goes bananas and you cannot stop them...
    #3 unplug power all locos stop.
    #4 take sd card and reload same thing steves dcc++ex or dccex which ever gets on there .
    Right now im reloading steves image and will try one more time (punishment to me )im beginning to HATE this .But i dont like to lose......its that dang PI4 thats giving me fits arduino has been working fantastic in fact it still working. with out pi4
    the very last time i had it running today was when i installed was following this guys build and it worked untill i shut it off and went to church. came home and it messed up...

    kinda long but im frustrated and cant figger out i can't get this working when 100's if not more out there have it working good for them and im doing the same thing they are.....(not the first time ive done this prob 8 times in a few years now ) same thing over and over....
     
  2. sidney

    sidney TrainBoard Member

    1,249
    2,122
    38
    pic of my setup
     

    Attached Files:

  3. FlightRisk

    FlightRisk TrainBoard Member

    548
    237
    14
    Hi Sidney,

    Yes, a lot of us do use Steve Todd's image. He is on the DCC-EX team also so the Steve Todd Image, Engine Driver, and JMRI DCC-EX features are all developed together by the team to take advantage of new features as we add them. If you flashed the image successfully and can run JMRI, then I would think you issue is just a JMRI configuration or a ports issue. You need to have the WiThrottle Server in JMRI running to connect throttles. (You can, or course connect your throttles directly to the EX-CommandStation using the <DCC-EX> protocol or WiThrottle also).

    To help you get through the ++ and EX and DCC- confusion, DCC++ was the original "Arduino Base Station", we took over development calling it DCC++EX. Since we then completely re-wrote it from scratch and formed a company around it and named the company DCC-EX (dropping the ++) and called the Command Station EX-CommandStation. To be consistent with standard terminology, we also call it a "command" station and not a "base" station.

    So short version: DCC-EX is the company, EX-CommandStation (or EX-CS for short) is the product.

    Now to helping you get through your Pi issues. I would suggest that the best way to get that kind of support is to click the link below and join our Discord Server. The nature of Discord and our global team of people means that you can chat in real-time, pretty much 24/7 to get help. Since Steve is on the team, you can talk directly with him. However, others I'm sure will pipe in and share their JMRI expertise. Both Steve and Kevin Smith do JMRI seminars as it relates to the EX-CommandStation. You can "address" people with the @ symbol, so typing @mstevetodd and @KC Smith (who is also here) will flag them. If you look for the "EX-CommandStation" in the list of things to the left, you will see a channel labeled #jmri. Just click on that and start typing. When you hit the enter key it will send the message and someone will answer. You can get input here and there. If we answer the questions there, we can post the results here for everyone to see.

    A quick thing to do on your locos is to put them on the programming track and turn off DC mode so that they run only on DCC (CV 29, bit 2). Sounds like you have runaway loco syndrome. You can do this from JMRI, or send the command from the DCC++ command window in JMRI, or just do it from the Arduino Serial Monitor. You can even do it using Engine Driver or EX-Toolbox on your phone. The manual command is <W 29 2>. That is a capital "W". That will set the bits in CV29 to turn off DC mode. You can make sure the other bits are the way you want by looking at the CV29 calculator here: https://www.2mm.org.uk/articles/cv29 calculator.htm We have lots of other settings we can look at and we can address those one at a time.

    Get support on Discord: https://discord.gg/y2sB4Fp
     
    Erik84750 likes this.
  4. Sumner

    Sumner TrainBoard Member

    2,849
    6,018
    63
    1. Is everything running off the same power supply? If so can you at least run the Pi off a different power source for a bit?

    2. What is the power into the PI.

    3. If you leave the command station off and you turn the Pi on by itself does JMRI come up on the screen? If not something is wrong with the image card. It should boot right to the JMRI screen.

    4. With JMRI up and the Command Station on you should be able to start a JMRI throttle from I think the 'tools' menu. Make sure you can turn the track power on/off in the throttle and can run a loco. Let's start there.

    5. Also if I use my phone as a throttle I need to turn turn 'Mobil data' in setting off for it to connect.

    6. Do you see the RPi-JMRI network on the phone throttle?

    Sumner
     
    Erik84750 likes this.
  5. sidney

    sidney TrainBoard Member

    1,249
    2,122
    38
    YES and it does not matter if i run pi from separate power. went threw all that before...

    Dunno its supplied by the monitor which is for the pi4 thats why i bought that monitor.

    YES it will boot right to jmri...

    Yes i have to do the same thing..

    YES i do but cant access it because of password ect ive tried many times and it will not connect....THIS IS WHY i need the PI4 to get its wifi working then i can access it through my home network...

    now having all that said if the PI4 would get its wifi working then and only then can i connect. BUT i can not get that to work either.
    Ive had it working before but the trains short out and all goes bonkers then nothing works or responds to commands and this is very repeatable when i can get the dang thing working . ive also been working with steve on this but no worky yet.
     
  6. sidney

    sidney TrainBoard Member

    1,249
    2,122
    38
    ok got the wifi working on the pi4 but no internet. so now its not connecting to my internet. why is this stupid thing so dam complicated...what happened to click install it works....??????????
     
  7. Sumner

    Sumner TrainBoard Member

    2,849
    6,018
    63
    With the image file only loaded it isn't going to connect to your home network unless you want to make changes and I forgot how.

    Why do you want it to connect to your home network? You use your throttle and connect to the JRMI network on the Pi. It should be broadcasting and your throttle should see it and connect to it if you have entered the password which can be automatic....see next paragraph.

    In your network_config.h file do you have the following? We had it there before I think but you might of replaced that file when you were having problems the other day. If you take the example file and only rename it then it won't automatically put the password in and connect.

    ===============================================================

    // enter the SSIDs and passwords of as many networks you wish to try to connect to.
    const int maxSsids = 1;

    // There must be the same number of entities (specified above) in each of the following arrays

    const String ssids[maxSsids] = {"RPi-JMRI"};
    const String passwords[maxSsids] = {"rpI-jmri"};

    =========================================================

    The one line above is the name 'RPi-JRMI' and the other is the password 'rpI-jmri.

    At this point there is only a small group of us using the WiTcontroller throttle. So think of yourself as being on the cutting edge of new technology :).

    The other day you want to see 0-28 speed steps on the throttle screen. I think a few hours later Peter had added that for you and you had updated the throttle and now have that. What do you think if you would of called up ESU, NCE, MRC or Digitrax and requested the same thing ;).

    I'm sure there will be an 'auto-installer' at some point like there is for the DCC-EX Command Station but it will probably be a bit. On the plus side think of all the new skills you have acquired since there isn't one ;).
    ================================================================

    So back to the command station/Pi situation. Let me know if you can connect by either adding those lines to the network_config.h file or by entering then when you see the JMRI network. If you aren't seeing the network then something else is still wrong.

    Sumner
     
  8. sidney

    sidney TrainBoard Member

    1,249
    2,122
    38
    sumner all good points (y) sometimes i let my frustration take over then i need to get away from it.....
    I need the pi4 to get on my home network so i can update ect . Initially i was thinking i could access the pi4 through my throttle to get at jmri.
    But thats never gunna happen, so that's out of mind head now....
    I really dont need it for that.

    sumner :.. I can access jmri through the Arduino once i start up the withrottle server... That part works great.(y):D

    Yes peter did a great job of the change to 0-28 and boy o boy im loving that even more now. Im very happy that we all built this. Its way better than the phone throttle and bonus is battery last all day or longer. i still have not charged it up (i prob should check that )....I cant say enough about that throttle it was cheap to build and it works FANTASTIC.....

    on the one click thang..... that was more geared to the raspberry software. That should have been automatic in getting the wifi + internet right off...

    Ok so update on pi4 i still have no internet but do have the wifi bars thingy at the top flashing like it's got wifi. just no connection to internet.
    once i can get the PI4 getting internet (so i can open browser) then ill short out the track and see if it goes bonkers again.
    I know there is some lil thing that im not seeing and i prob turned it of somehow.
     
  9. Sumner

    Sumner TrainBoard Member

    2,849
    6,018
    63
    Why, I guess I'm not understanding why. Update what?

    When JMRI comes up on the screen without you doing anything it should also of activated the WiThrottle and set up a WiFi hotspot on the Pi. You won't be connecting with the throttle (either one) through the WiFi board on the command station. You will be connecting via JMRI and the Pi's WiFi. The throttle connects to that and sends loco commands. Then JRMI relays those commands to the command station via the USB cable from the Pi to the Arduino.

    If you still have the WiFi shield on the Mega then I'd think the throttle would show two networks, JMRI and DCC-EX and you should be able to logon to either. I ran one of my command stations with the WiFi board at one point and think I remember being able to connect to either. The throttle will still see the home WiFi and maybe a neighbor's or two (mine does).

    I'm assuming you have a keyboard/mouse and monitor connected to the Pi to program decoders with. You should also be able to pull up a JMRI throttle on the monitor and turn track power on/off and run a train that way also.

    Sumner
     
  10. sidney

    sidney TrainBoard Member

    1,249
    2,122
    38
    ok # 1 i can get the jmri to my withrottle no problem with that..

    #2 the problem i had before was shorting locos out on the track made the system go bonkers IE no control of any thing....
    That seems to have disapeared with the new install of dccex.....ive shorted the tracks 4 or 5 times and no problem it comes right badck and i have full control of locos.. DONE fixed some how with new version of dccex

    # 3 im trying to get the pi4 to access my home network and i have the bars thingy working at the top. BUT there is no internet when i open the browser.
    see pics
     

    Attached Files:

  11. Sumner

    Sumner TrainBoard Member

    2,849
    6,018
    63
    Just found the following... ( HERE )...

    When the Pi is your network to connect to JMRI with your throttle it is 'an access point'. If you want it to connect to your home network so that it is connected to the Internet it becomes 'a client' and your home network is the 'access point'. Sounds like the Pi can't be both. I didn't study it more to see if there was an easy solution so you are on your own....maybe Steve on Discord can explain your options. I'm not interested so won't be trying to figure it out. Still not sure why you want to get on the Internet with the Pi. Best of luck.

    ===============================================================================

    Disable Access Point and Enable Wifi Client
    The RPi wifi adapter cannot be used as an access point and a wifi client to another network at the same time. Here are the steps to change the wifi to be a client only:

    Disable the access point functionality by removing hostapd using:

    sudo apt-get remove hostapd;
    then remove the related config by modifying your /etc/dhcpcd.conf file:

    sudo nano /etc/dhcpcd.conf;
    to comment-out (add a leading # to) the last three lines in the file, as such:

    #interface wlan0
    #static ip_address=192.168.6.1/24
    #nohook wpa_supplicant
    Then save and exit by pressing [Ctrl-O], then [Enter], then [Ctrl-X], and then reboot your RPi.
    at this point, you'll need to have access to your RPi desktop via monitor, keyboard, mouse or connect to Ethernet and use a VNC client.
    Unhide the wifi icon by right-clicking in the panel area, select "Add / Remove Panel items", "Add", "Wireless & Wired Network".
    Then use the wifi icon to select your wifi network, set the password, etc.
    Reboot again with ethernet cable disconnected (if it was connected).
    You should now be able to ping and connect to "RPi-JMRI.local" from devices on your wifi network.

    =======================================================================

    Maybe Ash or someone else can help with this more than I can.

    So it sounds like you can connect to DCC-EX now using the Pi and JMRI and maybe the shorting problem is fixed?????

    If you would put your locos into a roster with Decoder Pro you would see them on your throttle when you go to 'Add a Loco' and not have to remember the road number (most are too small for me to see). If you tried it I'll bet you would like it,

    Sumner
     
  12. sidney

    sidney TrainBoard Member

    1,249
    2,122
    38
    Yes sir that has went away and i think it has to do with me installing the newest version of dccex. because it does not happen now (at least so far anyway)

    I just might try this now that pi4 and dccex are working for me...
    My BIGGEST issue was the locos shorting out and me not having any control of anything after that. But like i said that has went away with the newest version. I dont remember what version it was that i had the problem with. all i know is its gone now...

    sumner Steve is helping me figger out the wifi problem we had been exchanging emails .. i know its something simple i just dont know enough about this stuff. im learning so thats good...
    i also removed that hosapd thingy and i think thats how i got the wifi bars at the top working. the rest i dunno..
    Im just happy that the when the locos short out i can remove the short and all is good again. this makes me want to run the pi4 and jmri system more now.
     
  13. sidney

    sidney TrainBoard Member

    1,249
    2,122
    38
    this is my problem now...see pic
     

    Attached Files:

  14. Sumner

    Sumner TrainBoard Member

    2,849
    6,018
    63
    Is that the Pi screen.

    Confused did you get the problem figured out how to get around the fact that the Pi can't be an 'access point' (where you can get to JMRI and the WiThrottle app with the throttle) at the same time it is a 'client' that is trying to connect to your home network? From what I've read it can't be both at the same time.

    So either you are controlling trains with your throttle or you stop that and you want to connect to the internet with it for I'm still not sure what?

    Sumner
     
  15. sidney

    sidney TrainBoard Member

    1,249
    2,122
    38
    YEEEEEEEE sids HAPPY HAPPY HAPPY. Steve got me all straightened out. took a bit and had to reload the sd card again with his image.
    Now i can use this thing full time on my layout...

    OBOY now one more problem. i shorted out the track to see if the same ol problem i had before would crop up and that part did not happen but another problem did happen is that the whole unit shut down and rebooted. GRRR
     
  16. sidney

    sidney TrainBoard Member

    1,249
    2,122
    38
    ok video for new problem....

    this will explain better than i can
     
  17. Sumner

    Sumner TrainBoard Member

    2,849
    6,018
    63
    Weird, just went out and did the same test with mine. Shorted the track....loco stopped and monitor stayed on....removed washer and train started at the speed it was running at right away. I repeated this about 5 times. The Pi never rebooted.

    Humor me and move the mega to a different power supply. I assume that the motor shield is also on a different power supply. That should leave the Pi connected to the monitor and nothing else connected to the monitor. Also the only connection between the mega and the Pi would be the USB cable.

    Of note is that my image file is probably 2-3 years old along with the DCC-EX on the mega.

    Sumner
     
  18. sidney

    sidney TrainBoard Member

    1,249
    2,122
    38
    OK ive resolved this... apparently you have to power the pi4 with separate power supply . thought i would try this and that has worked out . pi4 still shuts down but fires right back up and indeed locos resume there speeds.
    why that would make any difference i have no idea power is power . mower 12 volts goes to monitor then the monitor splits that power to Arduino then to pi4.....im not understanding this.... but hey BOTTOM line its working great now .. so im happy happy happy. TOOT TOOOOT
    if any body can tell me why that power from the monitor has any thing to do with it please let me know or tell me how to test that.
    problem solved and thank you.
    i hate running two power supply's...............:mad::)
     
  19. sidney

    sidney TrainBoard Member

    1,249
    2,122
    38
    Would a booster board thingy prevent this power interruption?????
    I tried a light bulb fuse thingy but that did not work , it still shut down. I was think that if there is a way to separate( fuse of some sort ect) track power from the command station that power issue would go away.. doe's that make any sense....
     
  20. Sumner

    Sumner TrainBoard Member

    2,849
    6,018
    63
    Are you saying that the Pi still shuts off and the screen goes blank and then it powers back up again and has to re-load JMRI?

    If so it shouldn't ever go off. If you get a short the locos stop....remove short... locos go back to running like they were. During all of that JMRI should still be up..................unless....like in my case there is a screen saver running and it has turned the screen off.

    All that the Pi is doing is running JMRI and sending commands it receives from the throttle on to the command station via the USB cable.

    Your problem running everything off a single power supply might be related to a ground issue in the circuit. I have the Arduino power supply, the motor-shield power-supply for the track power, a power supply for my monitor and a power-supply for the Pi. Most of those cost $6-$10. They are all plugged into one power strip. I turn it on and everything starts up. To shut down I run the 'shut down' on the Pi. It shuts down and the monitor goes blank. I turn the power strip off and it is all ready to start again when I turn the power strip back on. Can't get much simpler than that ;)

    I don't think a 'booster' would change a thing. You need it if you have enough locos and anything else powered by the DCC buss drawing more than about 2 amps (actually I think the command station 'trips' at about 1.8 amps). If you get a booster at some point then the command station won't be supplying any current to the track. The booster will be supplying all the current and the command station will just be sending loco instruction packets to the booster and it will send them on to the track.

    The Tam Valley boosters I bought are 5 amp but I have them set to trip at about 2 amps as 5 amps can still cause damage and I figure I can run about 8-10 locos on 2 amps and I'll never have that many running in a power district. I have 4 boosters and 8 power districts. I could have a lot more locos running that I ever will but they would be spread out between all the different power districts. I mainly have so many to help troubleshoot and find where the short is if I have one.

    If I was running a lager scale than N I'd probably have the booster set to the 5 amp setting.

    Sumner
     

Share This Page