We already have shown you local UDP sending data using the Arduino and Sixfab Arduino NB-IoT Shield. This time we are going to repeat the same tutorial using a Raspberry Pi and Sixfab R.Pi NB-IoT shield.
All we need is a Raspberry Pi and a Sixfab R.Pi NB-IoT Shield. Plug your shield on the R.Pi and connect your DHT AM302 sensor as follow fig.
We will test the shield on local host. It is necessary to make some configs to your router.
Now get your router’s IP and a UDP port by getting into your ‘Modem Router Settings‘ and find ‘Forwarding/Virtual Server’ then click on ‘Add New’. Here fill-up ‘Service Port’ (which will be any unique port number), ‘IP Address’ (IP address of your laptop or Desktop) and select Protocol as ‘UDP‘. Now save this configuration.
Now download the example python script which will send data using UDP from our Github repo.
Run the script.
Now to receive data open a new terminal and type the following command
netcat -ul -p5000
here 5000 is the UDP port.