Arduino USB driver modifies Espruino code?

Posted on
  • I have many connected USB devices on my computer. Last night, I went to set the RTC "DS1307" on my Arduino "Teensy 2" and used the wrong comport. The Arduino driver directed the upload to my Espruino RTC instead. In doing so, it set the external I2C RTC "DS3231" to the wrong time!

    How can my comport mis-direction make it so the Arduino IDE uploaded into the Espruino?

    Next time, I will remove all devices which I am not uploading to.

  • I'm surprised it managed to set the RTC to something different! I'd imagine that most code the Arduino IDE would send would just be interpreted as invalid JavaScript code.

    The Arduino IDE gets confused because it's just expecting to communicate with a serial port (or a USB device pretending to be a serial port) - it's older technology, and unlike USB there was never any way for the program to know which port it should talk to... If it sent some data and it didn't get the response it wanted, it was probably the wrong port :)

    The Espruino IDE would do the same thing as well I'm afraid.

    Windows tends to remember each USB device though and tries to give it its own number, so if your Arduino was on COM24 (or whatever it is) it should always stay at that number.

  • I share Gordon's surprise that you were able to achieve any result other than a confused Arduino IDE and a bunch of syntax errors resulting in the Espruino doing nothing. I suspect something else happened that resulted in the RTC changing time.

    Wouldn't it be nice if all COM port numbers stayed put! The cheaper (CH340G-based) serial adapters change depending on what USB port they're plugged into, and sometimes it seems just for the hell of it. I suspect some other devices do the same - I'll bet it's the same as the bullshit you get with some USB mice and thumbdrives, where you go through another round of "installing device drivers" if you plug it into a different port than you did last time.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Arduino USB driver modifies Espruino code?

Posted by Avatar for user7114 @user7114

Actions