Simple python UDP server for NB-IoT initial tests output:
Code:
waiting to receive message
1578122393.18: received 37 bytes from ('119.31.119.XXX', YYYYY)
1578122393.18: my signal csq: 22 rssi: -69dBm seq: 1
1578122393.18: sent 25 bytes back to ('119.31.119.XXX', YYYYY)
waiting to receive message
1578122398.14: received 37 bytes from ('119.31.119.XXX', YYYYY)
1578122398.14: my signal csq: 23 rssi: -67dBm seq: 2
1578122398.14: sent 25 bytes back to ('119.31.119.XXX', YYYYY)
waiting to receive message
1578122403.25: received 37 bytes from ('119.31.119.XXX', YYYYY)
1578122403.25: my signal csq: 25 rssi: -63dBm seq: 3
1578122403.25: sent 25 bytes back to ('119.31.119.XXX', YYYYY)
waiting to receive message
1578122408.17: received 37 bytes from ('119.31.119.XXX', YYYYY)
1578122408.17: my signal csq: 23 rssi: -67dBm seq: 4
1578122408.17: sent 25 bytes back to ('119.31.119.XXX', YYYYY)
waiting to receive message
1578122413.29: received 37 bytes from ('119.31.119.XXX', YYYYY)
1578122413.29: my signal csq: 23 rssi: -67dBm seq: 5
1578122413.29: sent 25 bytes back to ('119.31.119.XXX', YYYYY)
waiting to receive message
1578122418.24: received 37 bytes from ('119.31.119.XXX', YYYYY)
1578122418.24: my signal csq: 23 rssi: -67dBm seq: 6
1578122418.24: sent 25 bytes back to ('119.31.119.XXX', YYYYY)
waiting to receive message
1578122423.36: received 37 bytes from ('119.31.119.XXX', YYYYY)
1578122423.36: my signal csq: 23 rssi: -67dBm seq: 7
1578122423.36: sent 25 bytes back to ('119.31.119.XXX', YYYYY)
waiting to receive message
1578122428.32: received 37 bytes from ('119.31.119.XXX', YYYYY)
1578122428.32: my signal csq: 23 rssi: -67dBm seq: 8
1578122428.32: sent 25 bytes back to ('119.31.119.XXX', YYYYY)
The simple python code:
Code:
"""
NB-IoT First Test Code
Listens on a port for UDP, simple authentication, echo back with unix time
Version 0.11 4 January 2020
Neo wwww.unix.com
"""
import socket
import sys
import time
# Create a TCP/IP socket
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
# sock.setblocking(False)
port = 22222
# Bind the socket to the port
server_address = ('www.myudpserver.com, port)
print >>sys.stderr, 'starting up on %s port %s' % server_address
sock.bind(server_address)
password = "my_simple_password\n"
authenticated = True
receivepw = True
lastsent = 0
while True:
print >>sys.stderr, '\nwaiting to receive message'
now = time.time()
data, address = sock.recvfrom(4096)
print >>sys.stderr, str(time.time()) + \
': received %s bytes from %s' % (len(data), address)
stuff = str(time.time()) + ": " + data
print >>sys.stderr, stuff
# override simple authentication
if data:
lastsent = time.time()
if authenticated == False and receivepw == False:
sent = sock.sendto("Password: ", address)
receivepw = True
elif receivepw == True and authenticated == False:
if data == password:
sent = sock.sendto("Authenticated\n", address)
authenticated = True
else:
sent = sock.sendto("Password:\n", address)
print >>sys.stderr, 'a: sent %s bytes back to %s' % (sent, address)
elif authenticated == True:
received = "You sent: " + data
sent = sock.sendto(received, address)
data = time.time()
data = "Unix Time: " + str(data)+"\n"
sent = sock.sendto(data, address)
print >>sys.stderr, str(
time.time())+': sent %s bytes back to %s' % (sent, address)
else:
sent = sock.sendto("Error\n", address)
print >>sys.stderr, str(time.time())+' : sent %s bytes back to %s' % (sent, address)
Still waiting for Arduino GPS shield to arrive from China.
Another pic, this time with 9v battery for fun. I have a bench supply as well, but I usually don't take that out and put it on my balcony
dear experts
i want to install java install shield on solaris
but first i want to read more information and help about it
can anyone gives me some links or guids that helps me (0 Replies)
In my further exploration of Arduino, today I decided to install the arduino-cli on my mac today.
https://github.com/arduino/arduino-cli
I followed the instructions for macOS but when I got to this part:
arduino-cli board list
I got the dreaded "Unknown" Fully Qualified Board Name... (1 Reply)
Just finished a quick Python script to send the current unix time over to the Arduino from macOS, so in the absence of GPS or some other way to get the unix timestamp (epoch time) to the Arduino, I can get my macOS and Arduino UNO synced to within a second.
Normally, when the Arduino starts... (9 Replies)
My favorite projects are always related to the "latest" tech in command and control, networking and network communications. This Elecrow GSM/GPRS/EDGE SIM5360E 3G Shield seems to be the "latest and the greatest" as far as 3G and GPS, as far as I can see so far, but I has it drawbacks for sure.... (6 Replies)
Normally I have very good experiences buying from AliExpress, but in this case with Elecrow, I'm disappointed.
After confirming with Elecrow on AliExpress that their Elecrow GSM/GPRS/EDGE SIM5360E 3G Shield for Arduino would work with 3G SIM cards in Thailand, I purchased one. My plan was to... (1 Reply)
This post describes a "work in progress" project I started today. Here is the High Level Overview:
Currently, this project sits on my desk as an Arduino UNO (on the bottom), an NB-IoT Shield (sandwiched in the middle), a Sensor Shield (on top) with a HM-10 BLE Module (in the little... (13 Replies)