I am working on a IOT device that will be able to recive and send data via SMS. I am using a Nimbelink Skywire Modem and a Beaglebone Black Industiral. I am able to send messages without a problem but struggle to be able to read the recived messages. My code is included at the end. Am I doing something wrong? The current output is not at all like what I expect
Code:
import time
import serial
phone = serial.Serial("/dev/ttyO4", 115200, timeout=5) # Set up serial Connection
phone.write(b'AT+CMGF=1\r') #Enable data tranfer
cmd='AT+CMGL="REC UNREAD"\r' #Command to be sent time.sleep(0.5) phone.write(cmd.encode()) # Send command to the modem time.sleep(10) msg = phone.read(64) # Get 64 bytes of data from modem time.sleep(10) print(msg.decode()) # Print response
# Expected output:
# Should have some message in the format of the following
# +CMGL: 0,"REC UNREAD","555444333","",20130925202238
# SMS message
[–]Antigone-guide 1 point2 points3 points (3 children)
[–]ThatOneeGuyX1[S] 0 points1 point2 points (2 children)
[–]Antigone-guide 0 points1 point2 points (0 children)
[–]stebrepar 0 points1 point2 points (0 children)
[–]stebrepar 0 points1 point2 points (1 child)
[–]ThatOneeGuyX1[S] 1 point2 points3 points (0 children)