Raspberry pi gateway download/compile not workin

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at https://www.dialog-semiconductor.com/support . We’ll be fixing bugs / optimising the searching and tagging over the coming days.
2 posts / 0 new
Last post
nico.strydom
Offline
Last seen: 3 years 3 months ago
Joined: 2019-06-27 08:35
Raspberry pi gateway download/compile not workin

Hi

I've downloaded your Raspberry Pi Gateway Script Package for the raspberry pi.

We have a unit that we are able to connect via bluetooth to a smartphone, however the purpose of this device is to connect via a raspberry pi using your example scripts in Python.

However on initial_setup - it fails.

We have the new raspberry pi 4 (4gb)

Herewith the results of the build/execute of script. Please can you assist?

pi@raspberrypi:~/DEKRaspberryGateway $ sudo bash initial_setup.sh 
Updating
Hit:1 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:2 http://archive.raspberrypi.org/debian buster InRelease
Reading package lists... Done
Building dependency tree       
Reading state information... Done
36 packages can be upgraded. Run 'apt list --upgradable' to see them.
Installing packages
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libbluetooth3 is already the newest version (5.50-1+rpt1).
0 upgraded, 0 newly installed, 0 to remove and 36 not upgraded.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python3 is already the newest version (3.7.3-1).
0 upgraded, 0 newly installed, 0 to remove and 36 not upgraded.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python3-pip is already the newest version (18.1-5+rpt1).
0 upgraded, 0 newly installed, 0 to remove and 36 not upgraded.
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: enum34==1.1.6 in /usr/local/lib/python3.7/dist-packages (from -r /home/pi/DEKRaspberryGateway/requirements (line 1)) (1.1.6)
Requirement already satisfied: paho-mqtt==1.3.1 in /usr/local/lib/python3.7/dist-packages (from -r /home/pi/DEKRaspberryGateway/requirements (line 2)) (1.3.1)
Collecting PyBluez==0.22 (from -r /home/pi/DEKRaspberryGateway/requirements (line 3))
  Using cached https://files.pythonhosted.org/packages/c1/98/3149481d508bee174335be6725...
Collecting requests==2.18.4 (from -r /home/pi/DEKRaspberryGateway/requirements (line 4))
  Using cached https://files.pythonhosted.org/packages/49/df/50aa1999ab9bde74656c2919d9...
Collecting urllib3==1.22 (from -r /home/pi/DEKRaspberryGateway/requirements (line 5))
  Using cached https://files.pythonhosted.org/packages/63/cb/6965947c13a94236f6d4b8223e...
Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python3/dist-packages (from requests==2.18.4->-r /home/pi/DEKRaspberryGateway/requirements (line 4)) (2018.8.24)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/lib/python3/dist-packages (from requests==2.18.4->-r /home/pi/DEKRaspberryGateway/requirements (line 4)) (3.0.4)
Requirement already satisfied: idna<2.7,>=2.5 in /usr/lib/python3/dist-packages (from requests==2.18.4->-r /home/pi/DEKRaspberryGateway/requirements (line 4)) (2.6)
Building wheels for collected packages: PyBluez
  Running setup.py bdist_wheel for PyBluez ... error
  Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-dqfyrkzz/PyBluez/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-qnewgsnv --python-tag cp37:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-armv7l-3.7
  creating build/lib.linux-armv7l-3.7/bluetooth
  copying bluetooth/ble.py -> build/lib.linux-armv7l-3.7/bluetooth
  copying bluetooth/widcomm.py -> build/lib.linux-armv7l-3.7/bluetooth
  copying bluetooth/widcomm.py -> build/lib.linux-armv7l-3.7/bluetooth
  copying bluetooth/osx.py -> build/lib.linux-armv7l-3.7/bluetooth
  copying bluetooth/btcommon.py -> build/lib.linux-armv7l-3.7/bluetooth
  copying bluetooth/msbt.py -> build/lib.linux-armv7l-3.7/bluetooth
  copying bluetooth/__init__.py -> build/lib.linux-armv7l-3.7/bluetooth
  copying bluetooth/bluez.py -> build/lib.linux-armv7l-3.7/bluetooth
  running build_ext
  building 'bluetooth._bluetooth' extension
  creating build/temp.linux-armv7l-3.7
  creating build/temp.linux-armv7l-3.7/bluez
  arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I./port3 -I/usr/include/python3.7m -c bluez/btmodule.c -o build/temp.linux-armv7l-3.7/bluez/btmodule.o
  In file included from bluez/btmodule.c:20:
  bluez/btmodule.h:5:10: fatal error: bluetooth/bluetooth.h: No such file or directory
   #include <bluetooth/bluetooth.h>
            ^~~~~~~~~~~~~~~~~~~~~~~
  compilation terminated.
  error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
  
  ----------------------------------------
  Failed building wheel for PyBluez
  Running setup.py clean for PyBluez
Failed to build PyBluez
Installing collected packages: PyBluez, urllib3, requests
  Running setup.py install for PyBluez ... error
    Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-dqfyrkzz/PyBluez/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-o8agnsqi/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-armv7l-3.7
    creating build/lib.linux-armv7l-3.7/bluetooth
    copying bluetooth/ble.py -> build/lib.linux-armv7l-3.7/bluetooth
    copying bluetooth/widcomm.py -> build/lib.linux-armv7l-3.7/bluetooth
    copying bluetooth/osx.py -> build/lib.linux-armv7l-3.7/bluetooth
    copying bluetooth/btcommon.py -> build/lib.linux-armv7l-3.7/bluetooth
    copying bluetooth/msbt.py -> build/lib.linux-armv7l-3.7/bluetooth
    copying bluetooth/__init__.py -> build/lib.linux-armv7l-3.7/bluetooth
    copying bluetooth/bluez.py -> build/lib.linux-armv7l-3.7/bluetooth
    running build_ext
    building 'bluetooth._bluetooth' extension
    creating build/temp.linux-armv7l-3.7
    creating build/temp.linux-armv7l-3.7/bluez
    arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I./port3 -I/usr/include/python3.7m -c bluez/btmodule.c -o build/temp.linux-armv7l-3.7/bluez/btmodule.o
    In file included from bluez/btmodule.c:20:
    bluez/btmodule.h:5:10: fatal error: bluetooth/bluetooth.h: No such file or directory
     #include <bluetooth/bluetooth.h>
              ^~~~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
    
    ----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-dqfyrkzz/PyBluez/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-o8agnsqi/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-dqfyrkzz/PyBluez/
Done
DEKClient will start automatically upon system startup

Device: 
PM_Dialog
Offline
Last seen: 7 months 1 week ago
Staff
Joined: 2018-02-08 11:03
Hi nico.strydom,

Hi nico.strydom,

Thanks for your question online. The Gateway scripts are tested on Raspberry pi 9 (Stretch), so I am not completely sure if they are working on Raspberry pi 10 (Buster). Please, read section 7.6.2.2 of the UM-B-100: DA14585 IoT Multi Sensor Development Kit User Guide.  You could try to use the Rasberry Pi Gateway image instead of the scripts. In addition, the issue might be related to the fact that date is not set on Raspberry Pi and consequently pip install returned a certificate error.

The current project is acting only as a tracking application in order to upload assets to the Cloud. The connection functionality between the Raspberry pi and the 585 IoT MSK, is not currently supported. Please notice that we are working on that, and we expect to have something sharable in September timeframe. I will let you know…

Thanks, PM_Dialog