Ciao a tutti sto usando un raspberry e testando alcuni script in python. Ho un programma che fa il monitor del bus via python e funziona; ma non riesco in nessuno modo a ricevere dal bus di dati quando faccio una richiesta di energia attiva all'indirizzo 22 su un F520 usando netcat su raspberry o utilizzando questo script in python. Qualcuno mi può aiutare. Grazie #!/usr/bin/python # -*- coding: utf-8 -*- import socket import sys gateway_host = "192.168.1.35" # set here the IP of your gateway gateway_port = 20000 # set here the port of your gateway gateway_addr_port = gateway_host, gateway_port def send_message(msg): sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect(gateway_addr_port) sock.send(msg) # for arg in sys.argv[1:]: # cut off first argument (btsend.py) arg = '*#18*522*113##' send_message(arg) # send all arguments as message print ("Sending " + arg)
↧