ROS package for reading the MiFlora plant sensor.
ROS package freezes bluetooth adapter and stops working frequently.
Any ideas? Please open pull request or open issue.
Bluetooth monitor for light, moisture, electric conductivity, and temperature.
Requires python > 3.6
sudo add-apt-repository ppa:deadsnakes/ppa sudo apt update sudo apt-get install python3.7
sudo apt-get install python-pip libglib2.0-dev sudo python3.7 -m pip install miflora sudo python3.7 -m pip install bluepy
$ find /usr/local/lib -name bluepy-helper or $ find /home -name bluepy-helper $ sudo setcap cap_net_raw+e **PATH**/bluepy-helper $ sudo setcap cap_net_admin+eip **PATH**/bluepy-helper Where **PATH** is the place where bluepy-helper is installed.
catkin_ws/src$ sudo apt-get install python-catkin-tools catkin_ws/src$ git clone https://github.com/ros-agriculture/miflora_ros.git catkin_ws/src$ cd .. catkin_ws/src$ rosdep install --from-paths src --ignore-src --rosdistro ${ROS_DISTRO} catkin_ws$ catkin build catkin_ws$ source devel/setup.bash
catkin_ws$ rosrun miflora_server discover_devices.py This will print out the MAC address if found. 00:00:00:00:00:00
catkin_ws$ rosedit miflora_server client.launch
<arg name="Frame_ID" default="MEASUREMENT_FRAME"/>
<arg name="MAC_addr" default="00:00:00:00:00:00"/>
<!-- Sample Rate minimum is once per minute 0.01667 hz -->
<arg name="sample_rate" default="0.01667"/>
Start ROS Service
catkin_ws$ roslaunch miflora_server service.launch
Start the ROS Service Client to request readings
catkin_ws$ roslaunch miflora_server client.launch
Start both the service and client
catkin_ws$ roslaunch miflora_server read_sensor.launch
If your raspberry pi stops being able to connect to the sensor run:
$ sudo hciconfig hci0 down && sudo hciconfig hci0 up
The BLE device freezes a lot on a raspberrypi 3. Adding this crontab job will reset your BLE at a regular interval.
$ sudo crontab -e This will open a edit window. Then add this at the bottom: 5 * * * * hciconfig hci0 reset