Category : raspberry-pi

My raspberry code for one beacon: while True: try: devices = scanner.scan(1) for beacon in devices: if beacon.addr == ‘d0:f0:18:44:0b:82′: bc = "{}|{:d}".format(beacon.addr,beacon.rssi) sock.sendto(bc.encode(), server_address) except: print("Error") pass Windows code for one beacon: while True: bc, address = sock.recvfrom(4096) # buffer size adres, sygnal = bc.split(b’|’) # split print(adres, sygnal) This code works perfectly for ..

Read more

I created a telegram bot to make my Raspberry Pi take photos and videos and sending them to me. The code which makes the Pi taking the photo runs well, but when I add the line telegram_bot.sendPhoto(chat_id, photo=open(‘/home/pi/Pictures/%s.jpg’ % name , ‘rb’) there’s an "invalid syntax" SyntaxError in this line: telegram_bot = telepot.Bot(‘XXX:XXXXXX’) . On ..

Read more