Home › Forums › Forums › Technical Support for BerryGPS and BerryGPS-IMU › Can the minicom settings be scripted
Tagged: minicom scripting
- This topic has 3 replies, 3 voices, and was last updated 3 years, 7 months ago by Mark Williams.
- AuthorPosts
- April 13, 2020 at 2:12 pm #15722MariusMoldovanParticipant
I’m very new to this, so I wont be using the jargon correctly, sorry for the inconvenience. I see that many processes can be scripted and run at once with one script. I would like to try that. How do I go about adding the minicom settings such as “AT+UGGLL=1” to a script so that I don’t have to input them in manually every time I turn on my pi. Is there a way? Can you point me to a solution?
April 13, 2020 at 3:56 pm #15723PeterPParticipantyou don’t need minicon to send the commands to the device.
Have a lookt at this page, at the bottom it has a some examples of using “echo” and Python
echo -e "AT+UPSDA=0,3" > /dev/ttyACM1
#!/usr/bin/env python import serial, time port = "/dev/ttyACM1" PAUSE = 0.1 def sendCommand(command): command = command + "\r\n" ser.write(command) #ser.flush() output = ser.read_until() # default is \n print "Command sent:", output.rstrip() #rstrip will remove any trailing new lines or carriage return, this makes the output more readable response = ser.read_until() #response = ser.read(80) print "response", response time.sleep(PAUSE) ser = serial.Serial(port, baudrate = 115200, timeout = 0.2) sendCommand("AT+UPSD=0,1,\"hologram\"") #Set APN sendCommand("AT+UPSDA=0,3\r\n") #Activate connection to carrier time.sleep(PAUSE+3) #Give the modem time to connect sendCommand("AT+UGIND=1") #Activate the unsolicited aiding result sendCommand("AT+UGPS=1,4,71") #Turn on GNSS with online assistance and use GPS+SBAS+GLONASS+Galileo
Peter --OzzMaker.com --
April 17, 2020 at 11:28 am #15729MariusMoldovanParticipantI tried the code but i get a “no module named serial” error
I have another issue now. I have connected my berrygps-gsm to 3g and hologram, however, my berrygps-gsm fix light doesent blink now. I don’t seem to be able to get a fix. Is that supposed to be the case?
April 17, 2020 at 12:44 pm #15730Mark WilliamsKeymasterTry installing pyserial
sudo apt-get install python-serial
Mark --OzzMaker.com --
- AuthorPosts
- You must be logged in to reply to this topic.