You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ARM: 1CPU, 512MB RAM, 8GB disk space, network connection, Raspberry Pi OS (based on Debian 12) | Debian 12 operating system;
In some cases of Raspberry Pi when using internal WiFi and bluetooth, you should connect internal WiFi on 5GHz, because on 2,4GHz there may be a problem with connection stability (sharing same antenna).
Update your system and then install following packages:
Configuration is stored in user/export2garmin.cfg file (make changes e.g. via sudo nano):
Complete data in "miscale_export_user*" parameter sex, height in cm, birthdate in dd-mm-yyyy, Login e-mail, max_weight in kg, min_weight in kg;
To enable Miscale module, set "on" in "switch_miscale" parameter;
Complete data in "ble_miscale_mac" parameter, which is related to MAC address of scale, if you don't know MAC address read section 2.1.1.;
Configuration file contains many other options, check descriptions and use for your configuration.
Second script miscale/miscale_ble.py has implemented debug mode, you can verify if everything is working properly, just execute it from console:
$ python3 /home/robert/export2garmin-master/miscale/miscale_ble.py
=============================================
Export 2 Garmin Connect v2.3 (miscale_ble.py)
=============================================
18.11.2023-23:23:30 * Checking if a BLE adapter is detected
18.11.2023-23:23:30 * BLE adapter hci0(00:00:00:00:00:00) detected, check BLE adapter connection
18.11.2023-23:23:30 * Connection to BLE adapter hci0(00:00:00:00:00:00) works, starting BLE scan:
BLE device found with address: 00:00:00:00:00:00 <= target device
18.11.2023-23:23:34 * Reading BLE data complete, finished BLE scan
1672412076;58.4;521
Third script "import_data.sh" has implemented debug mode, you can verify if everything is working properly, just execute it from console:
$ /home/robert/export2garmin-master/import_data.sh
=============================================
Export 2 Garmin Connect v2.5 (import_data.sh)
=============================================
18.07.2024-16:56:01 SYSTEM * Path to temp files: /dev/shm/
18.07.2024-16:56:01 SYSTEM * Path to user files: /home/robert/export2garmin-master/user/
18.07.2024-16:56:01 SYSTEM * BLE adapter is ON in export2garmin.cfg file, check if available
18.07.2024-16:56:01 SYSTEM * BLE adapter hci0(00:00:00:00:00:00) working, check if temp.log file exists
18.07.2024-16:56:01 SYSTEM * temp.log file exists, go to modules
18.07.2024-16:56:07 MISCALE * Module is ON in export2garmin.cfg file
18.07.2024-16:56:07 MISCALE * miscale_backup.csv file exists, checking for new data
18.07.2024-16:56:07 MISCALE * Importing data from a BLE adapter
18.07.2024-16:56:39 MISCALE * Saving import 1721076654 to miscale_backup.csv file
18.07.2024-16:56:40 MISCALE * Calculating data from import 1721314552, upload to Garmin Connect
18.07.2024-16:56:40 MISCALE * Data upload to Garmin Connect is complete
18.07.2024-16:56:40 MISCALE * Saving calculated data from import 1721314552 to miscale_backup.csv file
18.07.2024-16:56:40 OMRON * Module is OFF in export2garmin.cfg file
If there is an error upload to Garmin Connect, data will be sent again on next execution, upload errors and other operations are saved in temp.log file:
To run it at system startup in an infinite loop, create a file sudo nano /etc/systemd/system/export2garmin.service enter previously searched path to import_data.sh and include "User" name:
You can check if export2garmin service works sudo systemctl status export2garmin.service or temporarily stop it with command sudo systemctl stop export2garmin.service.
2.1.5. How to increase BLE range
Purchase a cheap USB bluetooth adapter:
5.0/5.1 (tested on RTL8761B chipset, manufacturer Zexmte, works with Miscale and Omron module);
5.3 (tested on ATS2851 chipset, manufacturer Zexmte, works with Miscale module, does not work with Omron module).
Bluetooth adapter should have a removable RP-SMA antenna;
You will have option to change if standard RP-SMA antenna included with bluetooth adapter gives too little range;
Sometimes if you increase antenna range, scan time is too short to find your scale (too many devices around), you should increase scan_time parameter in scanner_ble.py script;
ATS2851 chipset has native support in Debian 12 operating system | Raspberry Pi OS (based on Debian 12) no additional driver needed;
If you are using a virtual machine, assign bluetooth adapter from tab Hardware > Add: USB device > Use USB Vendor/Device ID > Choose Device: > Passthrough a specific device (tested on Proxmox VE 8.3);
RTL8761B chipset requires driver (for Raspberry Pi OS skip this step), install Realtek package and restart virtual machine:
sudo apt install -y firmware-realtek
sudo reboot
If you are using multiple BLE adapters, select appropriate one by HCI number or MAC address (recommended) and set in user/export2garmin.cfg file;
Use command sudo hciconfig -a to locate BLE adapter, and then select type of identification:
By HCI number, set parameter "ble_adapter_hci";
By MAC address, set parameter "ble_adapter_switch" to "on" and specify MAC addres in parameter "ble_adapter_mac".
Sample photo with test configuration, on left Raspberry Pi 0W, on right server with virtual machine (stronger antenna added):