pycom / pycom-micropython-sigfox

A fork of MicroPython with the ESP32 port customized to run on Pycom's IoT multi-network modules.
MIT License
199 stars 167 forks source link

Can't send long AT commands using lte.send_at_cmd #411

Open leroxyl opened 4 years ago

leroxyl commented 4 years ago

Hello,

for my application I need to send long AT+CSIM commands (over 500 bytes) to the modem. Using lte.send_at_cmd with commands that size causes a crash. I followed the source code through the rabbit hole and found that the buffer behind this method is only 127 bytes big and a carriage return is automatically appended to the command here: https://github.com/pycom/pycom-micropython-sigfox/blob/Release/v1.20/esp32/lte/lteppp.c#L662 which hinders me from sending my command in several chunks.

Is there maybe another way to safely write to the UART without a carriage return being added?

Thank you!

robert-hh commented 4 years ago

As far as I understand the cited code, the CR is only sent if the command is "+++".

leroxyl commented 4 years ago

I fell for that, too. It looks counter-intuitive but strcmp returns 0 if the contents of both strings are equal and 0 evaluates to false.

robert-hh commented 4 years ago

Oops. You are right.

razvandragomirescu commented 2 years ago

I am experiencing the same issue, we are sending long command APDUs to the SIM card via AT+CSIM and we run out of space for some commands. This issue is almost 2 years old now, could you please fix it?