DCC++ESP32 Base Station

Atani Dec 10, 2017

Tags:
  1. dompondaco

    dompondaco TrainBoard Member

    30
    3
    2
    Thanks very much for the suggestion. Downloaded termite and works like a charm. Just wasted two days with platformio, I cant believe they want people to pay for it!!!
     
  2. Atani

    Atani TrainBoard Member

    496
    492
    10
    I haven't seen any problems with PIO and the built in terminal. But I did notice one oddity where it did not restart the esp32 when connecting the terminal. Usually it does restart though

    Sent from my ONEPLUS A5010 using Tapatalk
     
    dompondaco likes this.
  3. dompondaco

    dompondaco TrainBoard Member

    30
    3
    2
    hello Atani, wondering if there is any new word on your efforts reworking the html throttle and any other changes to the Base station code?
     
  4. Shdwdrgn

    Shdwdrgn TrainBoard Member

    193
    167
    8
    @Atani: I have some older code loaded up in my ESP32, so you may have addressed this already. Basically I have a Raspberry Pi acting as the WAP for my train, and while experimenting with it I think I noticed a problem. When the WAP reboots, the base station does not reconnect. This means I have to make sure I turn on the ESP32 *after* the Pi is loaded, or restart the ESP32 if I reboot the Pi.

    Just wanted to point it out in case you weren't aware.
     
  5. Atani

    Atani TrainBoard Member

    496
    492
    10
    Sorry I haven't had a chance to rework the HTML interface to shrink the throttle to a smaller size yet. I have this on my todo list still.

    That should be handled in the latest code in that it should auto-reconnect. You may need to update to the development branch though. Once I have a bit more free time I'll be wrapping up the code on the development branch and pushing out a new stable version.
     
    dompondaco likes this.
  6. Shdwdrgn

    Shdwdrgn TrainBoard Member

    193
    167
    8
    No worries here, Winter is coming so I'm sure we'll all be getting a lot more work done on our various projects soon enough. :)
     
    Atani and dompondaco like this.
  7. JoshMurrah

    JoshMurrah TrainBoard Member

    26
    4
    2
    Hi everyone! Thanks for making this fork for the ESP32!

    I have a weird issue upon doing my build... I got the hardware with recommend sheild with jumpers and the UNO format ESP32, code built/uploaded... there were a few character conversion errors in the secondary files but it built and uploaded. The hardware seems to function somewhat, I can turn on/off track power but a locomotive isnt' detected not CVs read. The big red flag is that when I connect JMRI, it dumps and reboots, continiously.

    Can you give give some tips/pointers?

    For background, I'm decent with basic Arduino sketches and already run a Pi with my Digitrax hardware for wifi AP/etc. but this cpp is new to me, as is the dev environment, so I'm a bit on the "monkey push the button" side of things.

    Thanks!!
     
  8. Atani

    Atani TrainBoard Member

    496
    492
    10
    it sounds like it is not able to connect to your WiFi. Connect a USB cable to the esp32 and check the serial console output. It should give you a clue as to why it is rebooting.
     
  9. JoshMurrah

    JoshMurrah TrainBoard Member

    26
    4
    2
    Sorry I didn't know what kinda details to give... it's on wifi, and I can load the html interface fine.

    I'm running yesterday's latest dev build.

    I have it connected via USB as well, and am monitoring the output via platformio.

    I'm thinking there's something out side of JMRI wrong possibly, since I was unable to control the two locomotives, however I was able to turn power on and the locos are getting good DCC base power (for example a sound loco is making its' usual sounds), I just can't aquire/control, in fact the loco doesn't show in the list.

    Here's the output I get whenever I load JMRI and connection is attempted via port 2560... the first few lines are manipulation via html interface to make sure it's live, then here's a reboot cycle once I start JMRI:

    [MotorBoard.cpp:162] powerOnAll(): Enabling DCC Signal for all boards
    [MotorBoard.cpp:45] powerOn(): [MAIN] Enabling DCC Signal
    [MotorBoard.cpp:45] powerOn(): [PROG] Enabling DCC Signal
    [MotorBoard.cpp:172] powerOffAll(): Disabling DCC Signal for all boards
    [MotorBoard.cpp:54] powerOff(): [MAIN] Disabling DCC Signal
    [MotorBoard.cpp:54] powerOff(): [PROG] Disabling DCC Signal
    [MotorBoard.cpp:162] powerOnAll(): Enabling DCC Signal for all boards
    [MotorBoard.cpp:45] powerOn(): [MAIN] Enabling DCC Signal
    [MotorBoard.cpp:45] powerOn(): [PROG] Enabling DCC Signal
    Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled.
    Core 1 register dump:
    PC : 0x400d3bdf PS : 0x00060930 A0 : 0x800db6fc A1 : 0x3ffb1f00
    A2 : 0x3ffd36a0 A3 : 0x00000000 A4 : 0x800d78fe A5 : 0x3ffc0bb0
    A6 : 0x00040000 A7 : 0x00000000 A8 : 0x5c0cffbb A9 : 0x3ffb1ed0
    A10 : 0x3ffb1f38 A11 : 0x00000000 A12 : 0x3ffb1ef8 A13 : 0x3ffc5c00
    A14 : 0x3ffc5c14 A15 : 0x00000000 SAR : 0x0000000a EXCCAUSE: 0x0000001c
    EXCVADDR: 0x00000010 LBEG : 0x4000c2e0 LEND : 0x4000c2f6 LCOUNT : 0xffffffff

    Backtrace: 0x400d3bdf:0x3ffb1f00 0x400db6f9:0x3ffb1f30 0x400d2c26:0x3ffb1f80 0x40142b4a:0x3ffb1fa0

    Rebooting...
    ets Jun 8 2016 00:22:57

    rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
    configsip: 0, SPIWP:0xee
    clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
    mode:DIO, clock div:2
    load:0x3fff0018,len:4
    load:0x3fff001c,len:952
    load:0x40078000,len:6084
    load:0x40080000,len:7944
    entry 0x40080310
    [DCCppESP32.cpp:171] setup(): DCC++ ESP starting up
    Unable to initialize InfoScreen, switching to Serial
    DCC++ESP: v1.2.0
    Starting Up
    Loading Config
    Init WiFI
    IP:pending
    [D][WiFiGeneric.cpp:345] _eventCallback(): Event: 2 - STA_START
    [D][WiFiGeneric.cpp:345] _eventCallback(): Event: 0 - WIFI_READY
    Connecting to AP
    [WiFiInterface.cpp:97] begin(): Connecting to WiFi: MurrahSlower
    [WiFiInterface.cpp:100] begin(): Waiting for WiFi to connect
    [D][WiFiGeneric.cpp:345] _eventCallback(): Event: 4 - STA_CONNECTED
    [D][WiFiGeneric.cpp:345] _eventCallback(): Event: 7 - STA_GOT_IP
    [D][WiFiGeneric.cpp:389] _eventCallback(): STA IP: 10.0.0.4, MASK: 255.255.255.0, GW: 10.0.0.1
    10.0.0.4
    MAIN Init
    [MotorBoard.cpp:41] GenericMotorBoard(): [MAIN] Configuring motor board [ADC1 Channel: 0, currentLimit: 2007, enablePin: 25]
    PROG Init
    [MotorBoard.cpp:41] GenericMotorBoard(): [PROG] Configuring motor board [ADC1 Channel: 3, currentLimit: 2007, enablePin: 23]
    [V][DCCppProtocol.cpp:263] registerCommand(): Registering interface command t
    [V][DCCppProtocol.cpp:263] registerCommand(): Registering interface command f
    [V][DCCppProtocol.cpp:263] registerCommand(): Registering interface command C
    [V][DCCppProtocol.cpp:263] registerCommand(): Registering interface command a
    [V][DCCppProtocol.cpp:263] registerCommand(): Registering interface command 1
    [V][DCCppProtocol.cpp:263] registerCommand(): Registering interface command 0
    [V][DCCppProtocol.cpp:263] registerCommand(): Registering interface command c
    [V][DCCppProtocol.cpp:263] registerCommand(): Registering interface command s
    [V][DCCppProtocol.cpp:263] registerCommand(): Registering interface command R
    [V][DCCppProtocol.cpp:263] registerCommand(): Registering interface command W
    [V][DCCppProtocol.cpp:263] registerCommand(): Registering interface command B
    [V][DCCppProtocol.cpp:263] registerCommand(): Registering interface command w
    [V][DCCppProtocol.cpp:263] registerCommand(): Registering interface command b
    [V][DCCppProtocol.cpp:263] registerCommand(): Registering interface command e
    [V][DCCppProtocol.cpp:263] registerCommand(): Registering interface command E
    [V][DCCppProtocol.cpp:263] registerCommand(): Registering interface command Z
    [V][DCCppProtocol.cpp:263] registerCommand(): Registering interface command T
    [V][DCCppProtocol.cpp:263] registerCommand(): Registering interface command S
    [V][DCCppProtocol.cpp:263] registerCommand(): Registering interface command RS
    [Outputs.cpp:99] init(): Initializing outputs
    [Outputs.cpp:104] init(): Found 0 outputs
    Found 00 Outputs
    [Turnouts.cpp:78] init(): Initializing turnout list
    [Turnouts.cpp:83] init(): Found 0 turnouts
    Found 00 Turnouts
    [Sensors.cpp:80] init(): Initializing sensors list
    [Sensors.cpp:85] init(): Found 0 sensors
    Found 0 Sensors
    [I][RemoteSensors.cpp:95] init(): Scanning for RemoteSensors DISABLED, remote sensors will only be created after reporting state
    [I][SignalGenerator.cpp:244] startSignal(): [OPS] Adding reset packet to packet queue
    [I][SignalGenerator.cpp:246] startSignal(): [OPS] Adding idle packet to packet queue
    [I][SignalGenerator.cpp:249] startSignal(): [OPS] Configuring Timer(0) for generating DCC Signal (Full Wave)
    [I][SignalGenerator.cpp:251] startSignal(): [OPS] Attaching interrupt handler to Timer(0)
    [I][SignalGenerator.cpp:253] startSignal(): [OPS] Configuring alarm on Timer(0) to 116us
    [I][SignalGenerator.cpp:255] startSignal(): [OPS] Setting load on Timer(0) to zero
    [I][SignalGenerator.cpp:258] startSignal(): [OPS] Configuring Timer(1) for generating DCC Signal (Half Wave)
    [I][SignalGenerator.cpp:260] startSignal(): [OPS] Attaching interrupt handler to Timer(1)
    [I][SignalGenerator.cpp:262] startSignal(): [OPS] Configuring alarm on Timer(1) to 58us
    [I][SignalGenerator.cpp:264] startSignal(): [OPS] Setting load on Timer(1) to zero
    [I][SignalGenerator.cpp:267] startSignal(): [OPS] Enabling alarm on Timer(0)
    [I][SignalGenerator.cpp:269] startSignal(): [OPS] Enabling alarm on Timer(1)
    [I][SignalGenerator.cpp:244] startSignal(): [PROG] Adding reset packet to packet queue
    [I][SignalGenerator.cpp:246] startSignal(): [PROG] Adding idle packet to packet queue
    [I][SignalGenerator.cpp:249] startSignal(): [PROG] Configuring Timer(2) for generating DCC Signal (Full Wave)
    [I][SignalGenerator.cpp:251] startSignal(): [PROG] Attaching interrupt handler to Timer(2)
    Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled.
    Core 1 register dump:
    PC : 0x400e49a7 PS : 0x00060031 A0 : 0x800d7c66 A1 : 0x3ffc0bb0[/I][/I][/I][/I][/I][/I][/I][/I][/I][/I][/I][/I][/I][/I][/I][/I][/I]
     
  10. dompondaco

    dompondaco TrainBoard Member

    30
    3
    2
    I am not an expert here, here are many other folks on this thread who will probably jump in a few. I do have the same problems you are having with reading CVs and I am experimenting with different things to get it to work. There is a lot of info on this thread and also on the DCC++ topic. As far as JMRI, everything has to be exactly set up for it to work properly, assuming you can get into Decoder Pro. If you cant suggest deleting JMRI entirely and try to reload it. Latest version is 4.12 + Rb6a9bb1. Don't forget to have the latest JAVA release installed as well. If you are trying to run JMRI with your system connected to it (as it should be) , try to start JMRI without anything connected. It will complain but eventually it will start and should dump you into a preferences screen.
     
  11. Atani

    Atani TrainBoard Member

    496
    492
    10
    I would highly recommend using the master version instead of development branch at this time. The code on development branch has not been fully tested yet. If you need some of the work on that branch go back to prior to the addition of consists as that work is still in flux and may be the source of the issue.

    Sent from my ONEPLUS A5010 using Tapatalk
     
  12. JoshMurrah

    JoshMurrah TrainBoard Member

    26
    4
    2
    OK I'll try that! I should have thought about that already ugh haha.
     
    Atani likes this.
  13. Atani

    Atani TrainBoard Member

    496
    492
    10
    I have been working on my studio area where my layout and office are so my test bed is not setup right now. I'll try and dig it all out of the boxes and get something setup so I can confirm this. The consist pieces will be in 1.2.0 as soon as I have it tested fully and have the config pieces sorted out. Also the HTML interface is getting a bit if a work over, exposing new features etc.

    Sent from my ONEPLUS A5010 using Tapatalk
     
  14. JoshMurrah

    JoshMurrah TrainBoard Member

    26
    4
    2
    I'm having an issue with the master build too... I guess I'm not up for this build heheh.

    src\WebServer.cpp:28:24: fatal error: index_html.h: No such file or directory
     
  15. Atani

    Atani TrainBoard Member

    496
    492
    10
    Are you using Arduino ide? If so grab the index file from the 1.1.0 release and use that, it should work

    Sent from my ONEPLUS A5010 using Tapatalk
     
  16. JoshMurrah

    JoshMurrah TrainBoard Member

    26
    4
    2
    nah using platformio per your wiki recommendation... althougth it's highly likely I botched something.
     
  17. Atani

    Atani TrainBoard Member

    496
    492
    10
    Ok there is an issue with the generation of the header file then. They changed something that broke it. Back to the development branch then. Go back a few commits to just prior to consists being added and you should be ok. I'll try and get a setup later today to debug this

    Sent from my ONEPLUS A5010 using Tapatalk
     
  18. JoshMurrah

    JoshMurrah TrainBoard Member

    26
    4
    2
    I'm pretty sure it's on my end... I went to the commit before consisting and it did compile like the latest dev did, but it does the constant reboot thing once I fire up JMRI and it accesses the port.

    I'm gonna dig up a Uno and start with the basics using Arduino IDE just to make sure I can make it work there first.
     
  19. JoshMurrah

    JoshMurrah TrainBoard Member

    26
    4
    2
    OK, I was able to get up and running on a Uno after reconfiguring jumpers.

    The only thing I don't care for so far in the DCC++ in general is:

    1) The master code is OLD and is obviously not getting developmental updates... the master build is three years old.
    2) There's been some individuals who are making some strides in areas such as making DCC++ district-aware and doing short circuits more intelligently... I miss the lack of auto-restart upon a short. Looks like nobody is regressing this into one "best build" anywhere. Dissapointing.
     
  20. Atani

    Atani TrainBoard Member

    496
    492
    10
    For the Arduino code in https://github.com/DccPlusPlus/BaseStation yes you are right, it is very much unmaintained at this point. But there are many forks that are more up to date, including https://github.com/atanisoft/BaseStation which I haven't done much on in a while but depending on need and availability I may make a few updates if needed.

    That sort of functionality is available on my fork as well as on the esp32 builds.
     

Share This Page