telelogger needs serial connection to boot

Discussion about software developed by Freematics, including Freematics Hub, Freematics Builder, Freematics Emulator GUI
Post Reply
barrythelion
Posts: 2
Joined: Tue Feb 23, 2021 8:29 am

telelogger needs serial connection to boot

Post by barrythelion »

Hi folks,

I'm just getting started with Freematics - I've managed to grab the telelogger code and I'm using the Arduino Builder to flash it. Everything works fine as long as the ONE+ is connected to the Builder and the serial port is open, but if I just supply power (eg by plugging it into my OBD port) the device doesn't boot. It's as if some logic is waiting for the serial connection before starting, but that doesn't seem to be there in the telelogger.ino. Is this something built into PlatformIO? Am I missing something simple here? I'd just like to be able to start the ONE+ and send data to the Hub without a serial connection.
stanley
Site Admin
Posts: 868
Joined: Sat Mar 01, 2014 3:15 am

Re: telelogger needs serial connection to boot

Post by stanley »

Have you tried uploading with PlatformIO?
barrythelion
Posts: 2
Joined: Tue Feb 23, 2021 8:29 am

Re: telelogger needs serial connection to boot

Post by barrythelion »

Hi Stanley,

Thanks for responding! Uploading with PlatformIO doesn't seem to make any difference. I also tried to upload a simple Blink sketch with Arduino and that had the same behavior, so I don't think the issue is with the code in telelogger.

I did a little more digging, but before I get into it let me say this is far from my area of expertise, so please take the below with a pinch of salt and don't get offended if I'm miles away from the truth :)

It appears that for an ESP32 to boot, the GPIO0 pin needs to be pulled high. From your Schematic diagram, it appears that GPIO0 is connected via transistors to the DTR and RTS pins of the UART chip, so that it is pulled high when DTR and RTS are high. There is no pullup on the GPIO0 pin, so when RTS is low the GPIO0 pin is left floating. Research online suggests that the behavior of the ESP32 when GPIO0 is floating is unpredictable, sometimes it will start and sometimes not, which matches what I'm seeing. I'm guessing that opening the serial port on the Freematics Builder is enough to pull DTR and RTS high, and that causes the device to boot.

EDIT TO ADD: Actually GPIO0 is *supposed* to have an internal pullup resistor, but the quality of this is dubious and on many units it doesn't work reliably without an external pullup. Maybe I just have a bad chip?

Does that make any sense at all? If so, is there a non-invasive way I could force GPIO0 high to test this theory?

Thanks again!
Post Reply