Xinyuan-LilyGO / LilyGO-T-A76XX

LilyGo A7670 A7608 SIM7672 series
MIT License
96 stars 42 forks source link

Problems with debugging code when the device is connected to computer #27

Closed mp-mba closed 1 year ago

mp-mba commented 1 year ago

Hi,

I've recently bought this device and I'm pretty happy with all the possibilities it gives me. I have just one problem which is very annoying and it makes writing and debugging code very hard.

I'm using platformio and this example mainly: https://github.com/Xinyuan-LilyGO/T-A7670X/blob/main/examples/new_version/Arduino/MqttClient/MqttClient.ino

The problem is that device have constant problem connecting to mqtt broker when it's connected to computer and when I'm watching serial monitor. When I detach the USB cable, reset the device it starting to work well and send metrics over mqtt (I have battery inserted).

Is my approach to program device wrong?

daveymg-nz commented 1 year ago

Hi, I'm by no means an expert wit this but I've been doing similar coding. I suspect that when the USB is plugged in then it is the only power source, the battery is not used. The modem chip can have quite high current spikes so you may be experiencing brown outs if your pc usb port can't supply sufficient instantaneous power. I have run mine successfully from usb power only (no battery connected) and haven't experience any modem connectivity problems.

mp-mba commented 1 year ago

Thanks. I've removed the battery, but it's behave the same.

daveymg-nz commented 1 year ago

That would be correct as the battery is not used when the usb is connected. Maybe check the power available from your usb port.

mp-mba commented 1 year ago

I've changed too many things at once to be able to say what was the issue. I've: