ESP32 Command Station

Atani Dec 10, 2017

  1. Cymen

    Cymen TrainBoard Member

    10
    11
    7
    I realized I was quite a bit behind on the github repo. I've updated however now when I try to build with PlatformIO, I get an error message:

    src/WebServer.cpp:28:24: fatal error: index_html.h: No such file or directory​

    I tried running "python build_index_header.py" but my system python is v2 and that fails on Import. So I used brew to install python3 and that gets further but fails like so:

    ~/dev/DCCppESP32 (master)*$ python3 build_index_header.py
    File "build_index_header.py", line 8
    print "Attempting to compress %s/data/index.html" % env.subst('$PROJECT_DIR')
    ^
    SyntaxError: invalid syntax
    I thought something was mentioned in this thread about this but I haven't found it yet. Thanks!
     
    Scott Eric Catalano likes this.
  2. Atani

    Atani TrainBoard Member

    1,469
    1,757
    37
    It looks like something in platformio may need an update as well. That line is valid syntax for python, unless the py file is somehow corrupted. Verify the file is using all spaces or tabs and not a combination of the two.

    Sent from my ONEPLUS A5010 using Tapatalk
     
    Scott Eric Catalano likes this.
  3. Shdwdrgn

    Shdwdrgn TrainBoard Member

    251
    182
    13
    Hey I was meaning to ask... is it possible to read a CV on the main track if no other decoders are present? Otherwise I was thinking I would just hook up that L298N board to a piece of flex track and ground out the ADC pin, except I thought when reading a CV the analog was required to detect the signal coming back from the loco?

    I'm also excited to have finally gotten my first function decoder working today! Took a week and a lot of digging and help from others, and oh so much frustration, but it finally worked. Now I'm trying to get an accessory decoder working because I actually wanted to run some turnouts with it, but running in to obstacles again. Ah well.
     
    Scott Eric Catalano likes this.
  4. Atani

    Atani TrainBoard Member

    1,469
    1,757
    37
    Reading CV on main is not supported. The ADC pin is used for detecting shorts and over current situations only for main.

    Sent from my ONEPLUS A5010 using Tapatalk
     
    Scott Eric Catalano likes this.
  5. Shdwdrgn

    Shdwdrgn TrainBoard Member

    251
    182
    13
    Ah cool so I don't really *need* the current detection on the programming track then? That makes it a lot easier to get set up with what I have on hand.
     
    Scott Eric Catalano likes this.
  6. Atani

    Atani TrainBoard Member

    1,469
    1,757
    37
    Programming track uses the same logic but at lower levels to detect an ack from the decoder.

    Sent from my ONEPLUS A5010 using Tapatalk
     
    Scott Eric Catalano likes this.
  7. Shdwdrgn

    Shdwdrgn TrainBoard Member

    251
    182
    13
    OK now I'm confused...Do I need the current sense on the programming track or will it work without that function?
     
    Scott Eric Catalano likes this.
  8. Cymen

    Cymen TrainBoard Member

    10
    11
    7
    I think I figured it out -- did a PR for it as I think the pre action needs to be on the filename.cpp.o not filename.o -- changing that fixed the build for me. I did double check I was all up to date with PlatformIO.

    With current master, I get "read failed" but each time the locomotive makes two pulsing noises (before, it only did it on the first attempt). So that seems better. I added the log_i call. How do I get to these logs? Do I have to be plugged into the ESP32 via USB? If so, I have to figure out some hijinks due to how I'm powering the device.
     
    Scott Eric Catalano likes this.
  9. Atani

    Atani TrainBoard Member

    1,469
    1,757
    37
    I will review the PR in the morning. It shouldn't matter which the dependency is on unless platformio has changed it for a diff platform, in any case maybe having it on both will be best.

    The log output will require serial console outout via USB.

    Sent from my ONEPLUS A5010 using Tapatalk
     
    Scott Eric Catalano likes this.
  10. Atani

    Atani TrainBoard Member

    1,469
    1,757
    37
    Thanks Cymen! I updated to Platform IO 3.5.2rc1 and hit the same issue this morning, v1.1.1 is now out with your PR merged in. I am working on a few other changes and will also include the log_i calls to the SignalGenerator code, hopefully to push it out on a dev branch today.
     
    Scott Eric Catalano and Cymen like this.
  11. Cymen

    Cymen TrainBoard Member

    10
    11
    7
    I was able to get some logging from sampleADCChannel in SignalGenerator.cpp. I ended up adding a wifiInterface.printf(F("<ADC %d>"), current) for now. I'm seeing 0 as the current value.

    I did figure out how to wire up my setup so I can hook up to the serial via USB. I'm going to get that fixed shortly so I can see all the logging.

    Does it matter if I am using a 16VDC power supply for the track instead of 15VDC?
     
    Scott Eric Catalano likes this.
  12. NormHal

    NormHal TrainBoard Member

    138
    126
    12
    Hi Atani! For me this latest V1.1.1 is great! Stable, can add S88 busses, delete them, as with turnouts and outputs, and NO resets:) My mock-up of 96 sensors is handled to perfection. Great Job! BTW, if anyone is interested in the (not-my-work) S88 code I use on the Arduino nanos as S88 input devices, just ask:)

    Some (low-priority) persistent quirks remain with the web-based throttle, but it certainly is very functional. Thanks for your consistent persistence!
     
    Scott Eric Catalano and Atani like this.
  13. Atani

    Atani TrainBoard Member

    1,469
    1,757
    37
    It shouldn't matter one bit. It sounds like there may be a problem with the analog current sense connections. Can you try using 34 (adc1_6) and 35 (adc1_7) and update config.h accordingly?

    Sent from my ONEPLUS A5010 using Tapatalk
     
    Scott Eric Catalano likes this.
  14. Shdwdrgn

    Shdwdrgn TrainBoard Member

    251
    182
    13
    It probably only depends on your particular DCC equipment. My power supply puts out 16.4V and works just fine with a SoundTraxx decoder, but I've seen some decoders that are much less tolerant of the input voltages.
     
    Scott Eric Catalano likes this.
  15. Cymen

    Cymen TrainBoard Member

    10
    11
    7
    It's working! I was going to try this but I thought I'd swap the A0/A1 connections just to check. I had it wired per post #156 like so:

    SVP-------A0
    SVN-------A1​

    I changed that now to:

    SVP-------A1
    SVN-------A0​

    And when I read CV1, I get 3! Yay!
     
    Scott Eric Catalano and Atani like this.
  16. Atani

    Atani TrainBoard Member

    1,469
    1,757
    37
    Excellent! I must have swapped them in the post. Good to know. Also the back of the lolin32 lite has a silkscreen of mapping which helps.

    Sent from my ONEPLUS A5010 using Tapatalk
     
    Scott Eric Catalano and Cymen like this.
  17. Shdwdrgn

    Shdwdrgn TrainBoard Member

    251
    182
    13
    I gotta say, I *really* hate dealing with the chinese vendors from ebay when something doesn't work. I've trying to return that first IBT board I got where one of the current-sense channels doesn't work. Essentially what I've gotten from the seller so far is "here's a copy of the schematics, can you fix it yourself?" Well I guess that gives me license to tear it down. :) I did manage to trace the header pins back to the chips last night, gotta break out the meter and see if anything looks fishy when comparing the two boards. Of course it could come down to one of the chips being bad. Ah well I'm not planning on digging into it too deeply, it's just not really my problem (although I am curious enough to poke at it).

    Which reminds me, I need to order some of those big resistors to modify my L298N board.
     
    Scott Eric Catalano likes this.
  18. Cymen

    Cymen TrainBoard Member

    10
    11
    7
    @Atani Is the DCC signal in TTL voltages before it goes to the Arduino motor shield? I'm wondering if I can hook up my clone Saleae logic analyzer to see the DCC signal by tapping into the connections between the ESP32 and the motor shield. I did order some diodes and opamps so I could hook right up to the track but I thought maybe the signal is already there to tap into without more circuits. This is just out of curiosity/learning, not trying to solve a problem. I found a Sigrok plugin for DCC. It's for version 2 of the plugin API instead of the current version 3 but that might be easy to fix.
     
    Scott Eric Catalano likes this.
  19. Atani

    Atani TrainBoard Member

    1,469
    1,757
    37
    It should be 3.3v or 0v as boundaries on the signal pin. The enable pin is always 3.3v when track is powered.

    I used a cheap dso138 with the probes wired to gnd and the signal pin. I have also connected the probes directly to the track and used AC mode.

    Sent from my ONEPLUS A5010 using Tapatalk
     
    Scott Eric Catalano and Cymen like this.
  20. Texas Tim

    Texas Tim TrainBoard Member

    53
    52
    9
    what would these set to on the ESP32 Wifi LoRa 32 board?

    according to the pin-out, I set these to these values, but the OLED is not on. 18 and 19 are used by LoRA. so I set to 12 and 13.

    Code:
    #define DCC_SIGNAL_PIN_OPERATIONS 12
    #define DCC_SIGNAL_PIN_PROGRAMMING 13
    
    #define INFO_SCREEN_SDA_PIN 4
    #define INFO_SCREEN_SCL_PIN 15
    
     
    Scott Eric Catalano likes this.

Share This Page