Maritim og Marin IIoT - dokumentasjon

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

Communication to internett - Azure VM

LPWA subscription from telia

  • 5G
  • Low Power Wide Area

Pros and cons - NB-IoT and LTE-M


Code for communication

RPI functionality (GUI_Interface)CodeClient functionality(RovRaspberry)Code

File: Interfacing.py

Line:  383

Functionality: Passing sensor values

def setDisplayValues(self, temp, depth, leak, lockedZones,
    salinity, conductivity, density):
        self.Temp.display(temp)
        self.Depth.display(depth)
        self.Salinity.display(salinity)
        self.Conductivity.display(conductivity)
        self.displayLeakStatus(leak)
        self.density = density
        self.Density.display(self.density)
        self.configureZonesDisplay(lockedZones)


File: main.py

Line: 85

Updating sensor values

if len(full_msg)-HEADERSIZE == msglen:

            RaspDataIn = pickle.loads(full_msg[HEADERSIZE:])

            a.setDisplayValues(RaspDataIn["temp"], RaspDataIn["depth"], RaspDataIn["leak"],
            RaspDataIn["lockedZones"], RaspDataIn["salinity"], RaspDataIn["conductivity"],
            RaspDataIn["density"])
            plotSonarInput(RaspDataIn["angle"], RaspDataIn["step"], RaspDataIn["dataArray"])



File: main.py

Line: 64

Initiating the recieved message.

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((SERVER, PORT))


(Inside while loop)

72. msg = s.recv(8192) # 8192











  • No labels