raspberry-identity.json
you want to use in the root folder"url"
to the commServer you want to use in raspberry_pi_pairing_information.json
raspberry-identity.json
to init the web view with the same identity.yarn start
or node lib/replicant/index.js start -l -c raspberry-identity.json --pairing raspberry_pi_pairing_information.json
if you want to adjust any CLI argumentssmiler-raspberry-v2.0.0.img
from the mailbox-drive
area "Freigegebene Datein".boot/firmware
folder.51-wlan-auto-connect-config.yaml
raspberry_pi_pairing_information.json
Ensure to set "url" to the comm server you want to use, e.g., "wss://comm.dev.refinio.one"raspberry-identity.json
has to be overwritten with your raspberry-identity-xxx.json. curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
source ~/.bashrc
nvm install --lts
npm i -g yarn
sudo apt install libudev-dev build-essential
You need to add the access rights for the HemoCue vendor to your udev rules.
Copy the 51-hemocue.rules file to /etc/udev/rules.d/
to allow HemoCue devices to access the USB interface.
sudo ln -s /home/ubuntu/one.raspberry/systemd/refinio-copy-image-configs.service /etc/systemd/system/refinio-copy-image-configs.service
sudo ln -s /home/ubuntu/one.raspberry/systemd/refinio-hemocue-replicant.service /etc/systemd/system/refinio-hemocue-replicant.service
see copy-image-configurations.sh
for what it does.
For all changes, you will need your Wifi ssid
and psk
for example:
When the raspberry pi runs ubuntu-server, netplan is used to configure networks.
51-wlan-auto-connect-config.yaml
and replace SSID-NAME-HERE
and PASSWORD-HERE
with your ssid and password.sudo cp 51-wlan-auto-connect-config.yaml /etc/netplan/
sudo netplan apply
or rebootWhen the raspberry pi runs Raspberry OS, wpa_supplicant is used for network configuration.
sudo vim /etc/wpa_supplicant/wpa_supplicant.conf
ssid
and psk
to the iPhone Hotspot valuesctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=DE
network={
ssid="SSID-NAME-HERE"
psk="PASSWORD-HERE"
key_mgmt=WPA-PSK
}
Follow these instructions
You will need this library.
sudo install libraspberrypi-bin
else you can follow the Raspberry OS instructions but instead of adding it to /boot/config you will need to add it to /boot/firmware/usercfg.txt
or just use:
echo program_usb_boot_mode=1 | sudo tee -a /boot/firmware/usercfg.txt
afterward reboot
sudo reboot
This will set a bit to 1 permanently, so you should remove the line afterward if you don't want to accidentally set the flag with images you might create from the current installation.
Before getting started with the creation of the img it needs to be prepared.
Make sure:
one.raspberry/contactObjects
one.raspberry/src/replicant/SmilerAccessRightsManager.ts
url
in /boot/firmware/raspberry_raspberry_pi_pairing_information.json
is wss://comm.smiler.one
yarn build
rm /home/ubuntu/one.raspberry/raspberry-identity.json
sudo rm /boot/firmware/raspberry-identity.json
sudo rm /home/ubuntu/one.raspberry/app-state.txt
sudo rm -rf /home/ubuntu/one.raspberry/OneDB
rm -rf /home/ubuntu/.ssh
Find the name of the microSD card disk
sudo fdisk -l
Disk /dev/mmcblk0: 119,1 GiB, 127865454592 bytes, 249737216 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xec116899
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 8192 532479 524288 256M c W95 FAT32 (LBA)
/dev/mmcblk0p2 532480 249737215 249204736 118,9G 83 Linux
Disk /dev/sda: 233,3 GiB, 250450280448 bytes, 489160704 sectors
Disk model: SanDisk 3.2Gen1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x63d166f6
Device Boot Start End Sectors Size Id Type
/dev/sda1 2048 489158655 489156608 233,3G 7 HPFS/NTFS/exFAT
Disk /dev/mmcblk0: 29,8 GiB, 31954305024 bytes, 62410752 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x4ec8ea53
For us, that is /dev/mmcblk0
First, you should resize the partitions of the microSD you want to copy. Therefore, you need to put your raspberry microSD into a card reader and preferably resize it with gparted. gparted calls some functions to prevent data loss when resizing a partition.
To be on the save side, we resize the writable
partition to 8000MiB, resulting in 7.81GiB.
To read only the needed parts do:
pi@raspberrypi:~/Downloads $ sudo fdisk -u -l /dev/mmcblk0
Disk /dev/mmcblk0: 29,8 GiB, 31954305024 bytes, 62410752 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x4ec8ea53
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 * 2048 526335 524288 256M c W95 FAT32 (LBA)
/dev/mmcblk0p2 526336 16910335 16384000 7,8G 83 Linux
To get the total byte count, multiply the Sectors by the Sector size 16384000 * 512 = 8388608000 bytes. (8000MiB) yes, that's what we resized the partition to excellent :) To speed up the copy, we will want to read in 4M blocks. We will need to know how many 4M blocks we want to read for the dd command. 1M is (1024 * 1024)bytes -> 4M is (4 * 1024 * 1024 bytes) = 4194304 bytes per block to read.
Now we divide the total bytes by the block size 8388608000 / 4194304 = 2000 blocks and add one block for good measure 2001.
This results in the following dd command:
sudo dd if=/dev/mmcblk0 of=/home/pi/Downloads/smiler-raspberry-v3.img bs=4M count=2001 status=progress
And you are done.
Select the device (/dev/mmcblk0) and make sure it is unmounted, then write to it.
sudo dd if=/home/pi/Downloads/smiler-raspberry-v3.img of=/dev/mmcblk0 bs=4M status=progress
we can use gzip to optimize the image size. This will shrink the img size from 7,8GiB to 1,6GiB :)
sudo dd if=/dev/mmcblk0 bs=4M count=2001 | gzip -c > /home/pi/Downloads/smiler-raspberry-v3.0.2.img.gz
gunzip -c /home/pi/Downloads/smiler-raspberry-v3.0.2.img.gz | sudo dd of=/dev/mmcblk0 bs=4M
The r before the disk name sais it should write it raw. Also vor bs it needs to be a lower case m.
gunzip -c SMILER/smiler-raspberry-v3.0.4.img.gz | sudo dd of=/dev/rdisk4 bs=4m
Call sudo tail -f /var/log/syslog
and plug the HemoCue in. You should see something similar to:
Oct 17 17:33:36 raspberrypi kernel: [ 650.688797] usb 1-1.1: new high-speed USB device number 6 using xhci_hcd
Oct 17 17:33:37 raspberrypi kernel: [ 650.819855] usb 1-1.1: New USB device found, idVendor=3785, idProduct=0006, bcdDevice= 0.01
Oct 17 17:33:37 raspberrypi kernel: [ 650.819874] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Oct 17 17:33:37 raspberrypi kernel: [ 650.819891] usb 1-1.1: Product: HemoCue WBCDiff Analyzer
Oct 17 17:33:37 raspberrypi kernel: [ 650.819906] usb 1-1.1: Manufacturer: HemoCue AB
Oct 17 17:33:37 raspberrypi kernel: [ 650.819921] usb 1-1.1: SerialNumber: 01910a00-530a-0000-0000-000000000000
If you see something longer like:
Oct 17 16:41:05 raspberrypi kernel: [ 9449.250996] usb 1-1.4: USB disconnect, device number 3
Oct 17 16:41:05 raspberrypi kernel: [ 9449.545425] usb 1-1.4: new high-speed USB device number 4 using xhci_hcd
Oct 17 16:41:06 raspberrypi kernel: [ 9449.645932] usb 1-1.4: Device not responding to setup address.
Oct 17 16:41:06 raspberrypi kernel: [ 9449.865697] usb 1-1.4: Device not responding to setup address.
Oct 17 16:41:06 raspberrypi kernel: [ 9450.085432] usb 1-1.4: device not accepting address 4, error -71
Oct 17 16:41:06 raspberrypi kernel: [ 9450.405439] usb 1-1.4: new high-speed USB device number 5 using xhci_hcd
Oct 17 16:41:22 raspberrypi kernel: [ 9465.865727] usb 1-1.4: new high-speed USB device number 6 using xhci_hcd
Oct 17 16:41:22 raspberrypi kernel: [ 9465.996723] usb 1-1.4: New USB device found, idVendor=3785, idProduct=0006, bcdDevice= 0.01
Oct 17 16:41:22 raspberrypi kernel: [ 9465.996742] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Oct 17 16:41:22 raspberrypi kernel: [ 9465.996758] usb 1-1.4: Product: HemoCue WBCDiff Analyzer
Oct 17 16:41:22 raspberrypi kernel: [ 9465.996773] usb 1-1.4: Manufacturer: HemoCue AB
Oct 17 16:41:22 raspberrypi kernel: [ 9465.996787] usb 1-1.4: SerialNumber: 01910a00-530a-0000-0000-000000000000
Oct 17 16:42:51 raspberrypi kernel: [ 9555.380618] usb 1-1.4: USB disconnect, device number 6
Oct 17 16:42:55 raspberrypi kernel: [ 9559.547280] usb 1-1.1: new high-speed USB device number 7 using xhci_hcd
Oct 17 16:42:56 raspberrypi kernel: [ 9559.678245] usb 1-1.1: New USB device found, idVendor=3785, idProduct=0006, bcdDevice= 0.01
Oct 17 16:42:56 raspberrypi kernel: [ 9559.678264] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Oct 17 16:42:56 raspberrypi kernel: [ 9559.678280] usb 1-1.1: Product: HemoCue WBCDiff Analyzer
Oct 17 16:42:56 raspberrypi kernel: [ 9559.678295] usb 1-1.1: Manufacturer: HemoCue AB
Oct 17 16:42:56 raspberrypi kernel: [ 9559.678309] usb 1-1.1: SerialNumber: 01910a00-530a-0000-0000-000000000000
Make sure you added the HemoCue USB rules see above.
make sure you have the right lineendings e.g. overwrite them on ubuntu with:
sed 's/\r$//' install.sh > install-u.sh && mv install-u.sh install.sh
Add a 1 to the end of /boot/firmware/cmdline.txt
and remove it again later.
Press enter to get into the maintenance mode and then use passwd.
Source for raspbian. Source for ubuntu-server
sudo apt update
sudo apt upgrade
Install the needed packages:
sudo apt-get install python-smbus i2c-tools
sudo apt-get install i2c-tools python3-pip; sudo pip3 install smbus2
Test if the installation was successful
sudo i2cdetect -y 1
will show a dump with one byte set to 68
.Load kernel driver on boot
dtoverlay=i2c-rtc,ds3231
to /boot/config.txt
then reboot.dtoverlay=i2c-rtc,ds3231
to /boot/firmware/usercfg.txt
then reboot.Check if it was enabled
sudo i2cdetect -y 1
should show the same dump but with UU
instead of 68
.Remove fake-hwclock
sudo apt-get -y remove fake-hwclock
sudo update-rc.d -f fake-hwclock remove
Activate orginal hwclock
/lib/udev/hwclock-set
if [ -e /run/systemd/system ] ; then
exit 0
fi
Check time of the RTC module
sudo hwclock -D -r
Update time of the RTC module
sudo hwclock -w
to write the time to the RTC module.The boot order can be changed by editing the EEPROM. This provides an example, which is summarized below.
sudo rpi-eeprom-config
sudo -E rpi-eeprom-config --edit
BOOT_ORDER=0xf14
means try usb boot firstBOOT_ORDER=0xf41
means try microSD card firstGenerated using TypeDoc