I'm using AT commands to send data over http, but the problem is that sometimes the program has an error and wont run again until I reboot and the GSM. Im using a crontab and also running the file as local file on boot. How could I fix the program to just begin the script again? How do I fix segmentation fault error.
Obviously, the interpreter is attempting to iterate
result, which (in the case your program crashes) isn't iterable because it's of type
NoneType. It seems like
result = execute(cmd). Looking at that function, there are two possibilities:
None. That's unlikely the case because the function is supposed to return an iterable type. Returning
Nonein any case is prone to crashes and bad practice.
There is an exception in
execute(). In this case (
except) the function will not return anything (
None) which I'm pretty sure is what crashes your program.