---
# System prepended metadata

title: Untitled

---

```shell=
ssh pi@raspberrypi.local
ssh-keygen -R raspberrypi.local

sudo date --set="2021-04-20 10:40:30"
```

```python=
import bluepy
import pandas as pd
import datetime

scanner = bluepy.btle.Scanner(0)
devices = scanner.scan(3)

now_t = datetime.datetime.now()

count = 0
for device in devices:
  df_t = now_t.strftime('%Y-%m-%d %H:%M')
  addr = device.addr
  rssi = device.rssi
  count += 1
  for (adtype, desc, value) in device.getScanData():
    if desc == "Manufacturer":
       value = value

       data = pd.DataFrame([[df_t,addr,rssi,value]])
       data.to_csv("/home/pi/Desktop/blue_scan/log.csv",index=False,encoding='utf-8', mode='a', header=False)

print(str(now_t) + ' : ' + str(count))
```