Can the minicom settings be scripted

Home Forums Forums Technical Support for BerryGPS and BerryGPS-IMU Can the minicom settings be scripted

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #15722
    MariusMoldovan
    Participant

    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?

    #15723
    PeterP
    Participant

    you 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 --

    #15729
    MariusMoldovan
    Participant

    I 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?

    #15730
    Mark Williams
    Keymaster

    Try installing pyserial
    sudo apt-get install python-serial

    Mark --OzzMaker.com --

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

Blip, blop, bloop…