1. Do not share user accounts! Any account that is shared by another person will be blocked and closed. This means: we will close not only the account that is shared, but also the main account of the user who uses another person's account. We have the ability to detect account sharing, so please do not try to cheat the system. This action will take place on 04/18/2023. Read all forum rules.
    Dismiss Notice
  2. For downloading SimTools plugins you need a Download Package. Get it with virtual coins that you receive for forum activity or Buy Download Package - We have a zero Spam tolerance so read our forum rules first.

    Buy Now a Download Plan!
  3. Do not try to cheat our system and do not post an unnecessary amount of useless posts only to earn credits here. We have a zero spam tolerance policy and this will cause a ban of your user account. Otherwise we wish you a pleasant stay here! Read the forum rules
  4. We have a few rules which you need to read and accept before posting anything here! Following these rules will keep the forum clean and your stay pleasant. Do not follow these rules can lead to permanent exclusion from this website: Read the forum rules.
    Are you a company? Read our company rules

Bug A very strange problem with serial communication

Discussion in 'SimTools DIY Version' started by tu xiao mi, Aug 16, 2021.

  1. tu xiao mi

    tu xiao mi Member Gold Contributor

    Joined:
    Aug 10, 2021
    Messages:
    71
    Balance:
    486Coins
    Ratings:
    +5 / 0 / -0
    My Motion Simulator:
    Arduino, 6DOF
    I use this https://github.com/knaufinator/6DOF-Rotary-Stewart-Motion-Simulatormethod.
    When I compete almost work, I found my Esp32 cannot simulate the servo.
    I use https://github.com/fbrussa/VirtualSim to test, it work very well.
  2. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    20,535
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    145,034Coins
    Ratings:
    +10,776 / 52 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    Can you please post pictures of all of your settings.
  3. tu xiao mi

    tu xiao mi Member Gold Contributor

    Joined:
    Aug 10, 2021
    Messages:
    71
    Balance:
    486Coins
    Ratings:
    +5 / 0 / -0
    My Motion Simulator:
    Arduino, 6DOF
    Sorry for not providing enough information. I am still not familiar with how to use this forum. Let me first send my settings page to you. SharedScreenshot01.jpg
    SharedScreenshot02.jpg
  4. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    20,535
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    145,034Coins
    Ratings:
    +10,776 / 52 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    Just to clarify, the VirtualSim works as expected, with its recommended settings?

    But the @knaufinator code and configuration does not, is that correct?

    Does Output Testing work at all with the @knaufinator code and settings?
  5. tu xiao mi

    tu xiao mi Member Gold Contributor

    Joined:
    Aug 10, 2021
    Messages:
    71
    Balance:
    486Coins
    Ratings:
    +5 / 0 / -0
    My Motion Simulator:
    Arduino, 6DOF
    VirtualSim works as expected,.
    VirtualSim needs to use network mode, while @knaufinator needs to use serial port mode. Their output methods are different, one is [A<Axis1a>][B<Axis2a>][C<Axis3a>], the other is <Axis1a>,<Axis2a>,<Axis3a>,<Axis4a>,< Axis5a>,<Axis6a>X
  6. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    20,535
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    145,034Coins
    Ratings:
    +10,776 / 52 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    Yes I understand they are different, does Output Testing work with @knaufinator's code and settings?
  7. tu xiao mi

    tu xiao mi Member Gold Contributor

    Joined:
    Aug 10, 2021
    Messages:
    71
    Balance:
    486Coins
    Ratings:
    +5 / 0 / -0
    My Motion Simulator:
    Arduino, 6DOF
    @knaufinator's code and settings does not work. the servo stop all the time
  8. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    20,535
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    145,034Coins
    Ratings:
    +10,776 / 52 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    Does it work with @knaufinator's Android app, if not it may be a hardware issue.
  9. knaufinator

    knaufinator Active Member

    Joined:
    Nov 16, 2017
    Messages:
    198
    Occupation:
    Simulation Engineer
    Location:
    akron,ohio
    Balance:
    1,736Coins
    Ratings:
    +226 / 1 / -0
    My Motion Simulator:
    AC motor, 6DOF
    The android app only connects to the BLE and allows you to stop movement,... i.e. ... e stop for a bystander...

    tu xiao mi - I thought you mentioned to me that the joggers work in the Output Testing tab of simtools to control the servos?
  10. knaufinator

    knaufinator Active Member

    Joined:
    Nov 16, 2017
    Messages:
    198
    Occupation:
    Simulation Engineer
    Location:
    akron,ohio
    Balance:
    1,736Coins
    Ratings:
    +226 / 1 / -0
    My Motion Simulator:
    AC motor, 6DOF
    Im confident we can work through this, we just need to step through the process. no point in testing simtools if we dont know if the PCB is working.

    • 1) we need to verify that the PCB can accept a serial command and process it.
      • make sure your servo is powered, and connected to PCB.
      • using Arduino serial monitor - boot the esp32 while connected (hit boot button) ... it should output its startup sequence, as well my codes startup ... paste this output to this forum thread,.. this is to verify the esp32 is happy.
      • next, send it a command to have it move around,...
        • by default, it thinks it is at the home position -
          • home = 2047 for each DOF i.e. "2047,2047,2047,2047,2047,2047X"
        • we want to move it somewhere else for testing.
          • send these commands over Arduino serial monitor to have the esp32 move all the arms equally , as we are only modifying the z axis height.
            • "2047,2047,1047,2047,2047,2047X" - will lower all the arms
            • "2047,2047,3047,2047,2047,2047X" - will raise all the arms
    We will move on from here once you can verify this is working.
    • Like Like x 1
  11. tu xiao mi

    tu xiao mi Member Gold Contributor

    Joined:
    Aug 10, 2021
    Messages:
    71
    Balance:
    486Coins
    Ratings:
    +5 / 0 / -0
    My Motion Simulator:
    Arduino, 6DOF
    what is the "joggers"?
  12. knaufinator

    knaufinator Active Member

    Joined:
    Nov 16, 2017
    Messages:
    198
    Occupation:
    Simulation Engineer
    Location:
    akron,ohio
    Balance:
    1,736Coins
    Ratings:
    +226 / 1 / -0
    My Motion Simulator:
    AC motor, 6DOF
    The "output testing" tab, the "Sliders" == Joggers.. can that move the servos
  13. tu xiao mi

    tu xiao mi Member Gold Contributor

    Joined:
    Aug 10, 2021
    Messages:
    71
    Balance:
    486Coins
    Ratings:
    +5 / 0 / -0
    My Motion Simulator:
    Arduino, 6DOF
    thank you very much for you helping
    below is my start message:
    ⸮ets Jun 8 2016 00:22:57
    rst:0x1 (POWERON_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:1
    load:0x3fff0030,len:1252
    load:0x40078000,len:12732
    load:0x40080400,len:3100
    entry 0x400805ec
    ⸮Load
    Axis 1: 100
    Axis 2: 100
    Axis 3: 100
    Axis 4: 100
    Axis 5: 100
    Axis 6: 100
    lpfVec vector loadedStarting BLE init!
  14. tu xiao mi

    tu xiao mi Member Gold Contributor

    Joined:
    Aug 10, 2021
    Messages:
    71
    Balance:
    486Coins
    Ratings:
    +5 / 0 / -0
    My Motion Simulator:
    Arduino, 6DOF
    and when I send 2047,2047,2047,2047,2047,2047X
    the Arduino IDE return the error message:
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at processing.app.Serial.write(Serial.java:254)
    at processing.app.Serial.write(Serial.java:274)
    at processing.app.SerialMonitor.send(SerialMonitor.java:122)
    at processing.app.SerialMonitor.lambda$new$1(SerialMonitor.java:66)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
    at java.awt.Component.processMouseEvent(Component.java:6539)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
    at java.awt.Component.processEvent(Component.java:6304)
    at java.awt.Container.processEvent(Container.java:2239)
    at java.awt.Component.dispatchEventImpl(Component.java:4889)
    at java.awt.Container.dispatchEventImpl(Container.java:2297)
    at java.awt.Component.dispatchEvent(Component.java:4711)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4904)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4535)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4476)
    at java.awt.Container.dispatchEventImpl(Container.java:2283)
    at java.awt.Window.dispatchEventImpl(Window.java:2746)
    at java.awt.Component.dispatchEvent(Component.java:4711)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84)
    at java.awt.EventQueue$4.run(EventQueue.java:733)
    at java.awt.EventQueue$4.run(EventQueue.java:731)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:730)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
  15. knaufinator

    knaufinator Active Member

    Joined:
    Nov 16, 2017
    Messages:
    198
    Occupation:
    Simulation Engineer
    Location:
    akron,ohio
    Balance:
    1,736Coins
    Ratings:
    +226 / 1 / -0
    My Motion Simulator:
    AC motor, 6DOF
    is there more?
    It should say - "init Estop check:....." after this... or is this all there is???

    I am talking about - Serial.print("init Estop check:"); from the Controller.ino line 422 in the setup method this lets us know about the state of the estop. this is important.... if you dont see it,... are you using an old version of the firmware?... you should update to the latest ... if that is all there is,.. it looks like the BLE init is hanging it up??? ..as its not used much,.. we could comment out the BLE init in the setup i.e. //setupBle();
  16. knaufinator

    knaufinator Active Member

    Joined:
    Nov 16, 2017
    Messages:
    198
    Occupation:
    Simulation Engineer
    Location:
    akron,ohio
    Balance:
    1,736Coins
    Ratings:
    +226 / 1 / -0
    My Motion Simulator:
    AC motor, 6DOF
    this is a new one... this is beond me,.. though possibly has something to do with the issue you are seeing,..

    maybe you don't have the proper drivers installed for the ESP32?,...

  17. tu xiao mi

    tu xiao mi Member Gold Contributor

    Joined:
    Aug 10, 2021
    Messages:
    71
    Balance:
    486Coins
    Ratings:
    +5 / 0 / -0
    My Motion Simulator:
    Arduino, 6DOF
    sometime can see "init Estop check" but I don't know which turn can see it
  18. knaufinator

    knaufinator Active Member

    Joined:
    Nov 16, 2017
    Messages:
    198
    Occupation:
    Simulation Engineer
    Location:
    akron,ohio
    Balance:
    1,736Coins
    Ratings:
    +226 / 1 / -0
    My Motion Simulator:
    AC motor, 6DOF
    It should always show up when you boot the esp32, its in the setup() function. is there more to that log?
  19. knaufinator

    knaufinator Active Member

    Joined:
    Nov 16, 2017
    Messages:
    198
    Occupation:
    Simulation Engineer
    Location:
    akron,ohio
    Balance:
    1,736Coins
    Ratings:
    +226 / 1 / -0
    My Motion Simulator:
    AC motor, 6DOF
    make a video, this helps as well, just show the process and get as much detail as you can into it.

    if your log does not show anything past this,.. everytime,.. there are odd issues we need to overcome...
    • Agree Agree x 1
  20. tu xiao mi

    tu xiao mi Member Gold Contributor

    Joined:
    Aug 10, 2021
    Messages:
    71
    Balance:
    486Coins
    Ratings:
    +5 / 0 / -0
    My Motion Simulator:
    Arduino, 6DOF
    I use this driver:
    WCH.CN
    |__ USB-ENHANCED-SERIAL-A CH342
    |__ 07/08/2020, 1.3.2020.7