예제 #1
0
def acceptCommandInput():

    received = SER.read()
    SER.send("Read: %s\n" % received)

    if received.find('QUIT') == 0:
        return 1
    elif received.find('LOG') == 0:
        Module.CPUclock(3)
        generateLog()
        Module.CPUclock(0)
    elif received.find('CONFIG') == 0:
        updateSettings(received[7:])
    elif received.find('STATE') == 0:
        SER.send(
            "\nsessionStart: %s\nactiveSector: %s\nreadSector: %s\n\n" %
            (Storage.sessionStart, Storage.activeSector, Storage.readSector))
    elif received.find('READ') == 0:
        setReadsector(received)
    elif received.find('CREAD') == 0:
        SER.send("\nCONFIG:%s,%s,%s,\n\n" %
                 (IMEI, Config.Mode, Config.Interval))

    return 0
예제 #2
0
def setup():
    initSettings()

    VOLT = Gauge.getBatteryVoltage()
    SER.send('Voltage: %s\n' % VOLT)

    # Don't start the network on a missing/near-empty battery
    if VOLT > 2500:
        initNetworkRelated()

    SER.send('Starting storage initialization at: %s\n' % MOD.secCounter())
    sector = Storage.initialize()
    SER.send('End at: %s. Sector: %s\n' % (MOD.secCounter(), sector))

    Module.CPUclock(0)  # Clock back to default (@26Mhz)
    SER.send('CPU back down\n')
예제 #3
0
import GPS
import MOD
import SER
import GPIO

# Set serial BAUD rate
SER.set_speed('115200')

SER.send('Start custom imports\n')

import Module
SER.send('Imported Module\n')

Module.CPUclock(3)  # Clock to 104Mhz
SER.send('Ramped up CPU\n')

import Config
SER.send('Imported Config\n')

import Gauge
SER.send('Imported Gauge\n')

import Storage
SER.send('Imported Storage\n')

SER.send('Done importing\n')

IMEI = Module.ATcommand('AT+CGSN').split('\r\n')[1]
URL = '/%s/track' % IMEI
SER.send('IMEI: %s\n' % IMEI)