Exemplo n.º 1
0
                sig = ExositeTelit.signalConv(res)
                DEBUG.sendMsg("Get signal strength: (" + str(sig) + ")dBm \r\n",RUN_MODE)
                
                # Update NMEA Data
                DEBUG.sendMsg("Polling GPS receiver for current location\r\n",RUN_MODE)
                CW20.update()
                DEBUG.sendMsg('Current GPGLL sentence: ' + CW20.GPSdata.GPGLL + "\r\n",RUN_MODE)
                ExositeTelit.setLatLng(CW20.GPSdata.GPGLL)                                          # Parses lat/lng values
                latlng = CW20.GPSdata.Latitude + '_' + CW20.GPSdata.Longitude
                # <-- Exosite
                
                DEBUG.sendMsg("Opening Connection to server: " + myApp.IP + ":" + myApp.PORT + "\r\n",RUN_MODE)
                            
                #Connect to customer demo server
                #Pass in: IP Address, IP Port, sockNum, GPRSuserName, GPRSuserPassword
                res = ATC.openSocket(myApp.IP,myApp.PORT,'1','','',myApp.PROTOCOL,RUN_MODE)

                try:
                    #If socket open upload data
                    if (res == 'CONNECT'):

                        DEBUG.sendMsg('Connection opened\r\n',RUN_MODE)
                        
                        # Build string to send to customer server
                        #STA = ATC.properties.IMEI +',' + CW20.GPSdata.GPGLL            # <-- Exosite: removed
                        
                        # Exosite -->
                        # Enter your resource ids as the <key> and data as the <value> of a Python dictionary
                        # Ex: Resourced ID #1 stores latitude/longitude data, Resource ID #2 stores ping data 
                        # resource_dict = {'1':latlng, '2':ping}
                        resource_dict = {