Modifications to Dave Bodnar's DCC++ Nextion Throttle

NormHal Jul 16, 2017

  1. NormHal

    NormHal TrainBoard Member

    138
    126
    12
    The latest upload has been downloaded by myself, and flashed to an Enhanced Nextion 3.5in. To me it's finally looking quite complete - I'd appreciate your findings:)
     
  2. jbsorocaba

    jbsorocaba TrainBoard Member

    47
    33
    12
    I live in Brasil, not a great country but is wonderful. Jbsorocaba is a junction of jb and Sorocaba which is the city were I live :)

    Great job Norm...you are the man.!!
    Thank you so much for your effort to help me. The display is apparently working.
    This weekend I will build a prototype of the system and make some try.

    Thanks again and have a nice weekend
     
  3. NormHal

    NormHal TrainBoard Member

    138
    126
    12
    Ok, thanks, but what do I call you? :) I'm Norm:)
     
  4. jbsorocaba

    jbsorocaba TrainBoard Member

    47
    33
    12
    You can call me Francisco
     
    Last edited: Aug 15, 2019
  5. Erik84750

    Erik84750 TrainBoard Member

    345
    136
    12
    Just now I found this great thread, thank you NormHal and others for all your incredible work.

    The reason baud rates >57600 are not working is due to a problem with SoftwareSerial.h: several years ago I ran into this same problem and answers to the reasons can be found in the Arduino forum: https://forum.arduino.cc/index.php?topic=339644.0 amongst others. Basically the problem is linked to the clockspeed of the Atmega AVR.
     
    Last edited: Dec 13, 2019
    NormHal likes this.
  6. Keith Ledbetter

    Keith Ledbetter TrainBoard Member

    279
    195
    12
    Thats a nice tidbit of info, thanks so much! I hope to get off my keister and back on some of this soon. great stuff.
     
    Erik84750 likes this.
  7. NormHal

    NormHal TrainBoard Member

    138
    126
    12
    Yes, Thanks! Erik! I had played a bit with one of the mini ATMega boards and found that worked perfectly. But your advice is greatly appreciated:)
     
    Erik84750 likes this.
  8. Erik84750

    Erik84750 TrainBoard Member

    345
    136
    12
    Hi NormHal, it is nice to meet you here!!

    To come back to your Nextion .hmi file and its use for a throttle: is there a requirement for a specific Arduino libray for use with it?

    The reason I ask is that a few knowledgeable people on the Arduino forum have raised questionmarks about Itead's commitment to further development, and that its Arduino library is virtually useless: https://forum.arduino.cc/index.php?topic=620210.0
     
  9. NormHal

    NormHal TrainBoard Member

    138
    126
    12
    Good to meet you too Erik! I've met a number of really good guys here - so great to get to know you too:)

    To answer your question about the library, I had continued to use the library Dave Bodnar used for his work - the "Bently Born" library - "https://github.com/bborncr/nextion". I found this library to be very easy to use while I was learning (and still am:)). I had tried to learn the library from iTead, and it didn't work for me. I then started working with Mike Dunston on his ESP32 Command Station, and did most of the HMI design for that. Mike favoured the "NeoNextion" library, by Dan Nixon - "https://github.com/DanNixon/NeoNextion", and Mike has subsequently been extending it as well. Whilst the NeoNextion library (and Mike's modifications) are very C++ based, which I'm trying very hard to learn, I have been able to make some sense of how Mike uses the library, and have been able to grow my knowledge a bit at the same time.

    With people like Mike Dunston involved, I personally think the Nextion product has a healthy future.

    All in all, good to have you along! Let me know if I can be of any help to what you're planning to do:)

    Best,
    Norm
     
    Erik84750 likes this.
  10. Erik84750

    Erik84750 TrainBoard Member

    345
    136
    12
    I hope there is still some interest in this thread, it is an absolute excellent starter for anyone with first-time Nextion experience. Thanks a lot to David Bodnar and NormHal for their work!
    I have an issue though: with the appropriate Naxtion display loaded with any of NormHal's .hmi files I cannot get any response from the buttons. Change address does not respond, not do the function buttons. The speed slider does respond to touch screen actions.

    What could be wrong (I use the enhanced version of display).

    Greetings,
    Erik
     
  11. rcmodeler

    rcmodeler TrainBoard Member

    47
    40
    7
    I've been using Nextion displays for many years without any librarys.
    Just read and send serial data. I'm using Arduino code.
    But that is maybe not the usual way :)
     
  12. Erik84750

    Erik84750 TrainBoard Member

    345
    136
    12
    Oh yes, it is -to me at least- the better way: avoiding Nextion library is possible for any project.
    Except: here the Arduino code (both by David Bodnar and NormHal) does use a Nextion library.

    My issue however is not with the Arduino code (which compiles fine) but with the Nextion configuration. The .hmi files from both David and NormHal do get compiled in the Nextion editor, but after upload I cannot do anything: for example changing DCC address for loco's does not respond on the display.

    What may be wrong?
     
  13. rcmodeler

    rcmodeler TrainBoard Member

    47
    40
    7
    Compiling doesn't mean everything is right, only no programmatic errors.
    Have you checked Arduino's serial monitor what's coming in?
     
  14. Erik84750

    Erik84750 TrainBoard Member

    345
    136
    12
    The serial monitor of the Pro Mini (where the Nextion is connected) shows traffic between command station and base station. The Nextion on the Pro Mini is connected to software serial: that does not get output to the serial monitor I think?

    Yet what concerns me is that the Nextion does not respond to touch action on its buttons except for the "Change address" and "Done" buttons which make the Nextion alternate between the 2 pages.

    This kind of lack of responsiveness to me seems more an issue with the Nextion programming itself than with comm's to the Pro Mini?
     
  15. rcmodeler

    rcmodeler TrainBoard Member

    47
    40
    7
    I don't know about your programming skills but it is quite easy to add a couple of lines in the Arduino code to show what is coming on software serial.
    For me, that would be the first approach in fault-finding. Everything else is just guessing.

    And you can, of course, use another Arduino to check your Nextion communication.
     
    Last edited: Dec 19, 2021
  16. Erik84750

    Erik84750 TrainBoard Member

    345
    136
    12
    Solved. It had indeed an issue with serial comm's between Pro Mini and Nextion: I had used a Pro Mini 8MHz, but compiled to 16MHz. All ok now (so far).
     
    Sumner likes this.
  17. rcmodeler

    rcmodeler TrainBoard Member

    47
    40
    7
    Good work :)
     
  18. NormHal

    NormHal TrainBoard Member

    138
    126
    12
    Hi Erik, just saw your post:) Good to hear you're still using the Nextion:) A similar "problem" caught me out too - the baud rate on Page 0:)
    I've been pretty busy with another project of late, and feel I might need to revisit the Nextion again pretty soon. The project I've been working with uses a web based mobile app and wifi which has kind of eclipsed the Nextion solution. However, I get pretty frustrated with the unreliability of the wifi method, and often wish for the directly attached Nextion... we'll have to see...
     
  19. Erik84750

    Erik84750 TrainBoard Member

    345
    136
    12
    Hi NormHal, so glad to see you back here!
    When searching for user experience with throttles I often notice how people miss the "hands-on" experience when using purely touch-screen devices, especially mobile phones: too much time spent with eyes on the screen. Hybrid solutions such as David Bodnar's (and your fantastic expansion of his ideas) where an actual throttle knob and direction knobs are used in conjunction with on-screen touch functions are -in my opinion- the way I would like to proceed for a throttle.

    Yesterday I had my very first experiences with your 3,5" Nextion setup -and for that matter my very first Nextion experience-, quite impressive!

    So I am very much looking forward to your upcoming experiments with Nextion based throttles.

    Alternatively, instead of using Nextion as both display and keypad, the use of a TFT LCD screen and an old-fashioned keypad drew my attention too:
    https://www.instructables.com/Model-Railroad-DCC-Command-Station/

    A lot clumsier than the Nextion concept, yet maybe more tactile? I woud be glad to hear opinions on this?
     
  20. rcmodeler

    rcmodeler TrainBoard Member

    47
    40
    7
    I'm not a fan of mobile phones or tablets as wireless controls, I want to be able to drive with a physical knob. So I built my own.
    I have been using these for nearly 3 years and they work fine:
    [​IMG]
    https://www.trainboard.com/highball...ino-wireless-remote-control-prototype.123447/
    It's just the standard Nextion display (not enhanced) and at the moment there are 10 different pages and some images, and there is a lot of space left in the memory.
    So, in my opinion, this is a cheap and effective solution to wireless control.
    And you can build it as you like, with batteries of your choice and the type of wireless you want.
     

Share This Page