-
Notifications
You must be signed in to change notification settings - Fork 2
Useful Technical details
On the Raspberry Pi...
sudo service homebridge stop
sudo killall nodejs
cd /Downloads/HAP-NodeJS
sudo node --inspect=0.0.0.0:9229 BridgedCore.js
Open chrome session<br>
Browse to chrome://inspect/
Click on 'open dedicated dev tools for node'
Add <IP address of the Raspberry Pi>:<Port 9229> e.g. 192.168.1.100:9229
After a few seconds, the Raspberry Pi node session should appear under 'Remote Target'
This views the text output from the alarm service, and is useful when debugging the interaction between the web page and the alarm service.
From the Raspberry Pi...
sudo service alarm stop
sudo /var/www/Scripts/alarm.sh
Ctrl+C
sudo service alarm start
This views the text output of the HomeBridge service, and is useful when debugging issues with the HomeKit accessories, or with the HomeBridge service failing to start.
NB. The HomeBridge service is written in TypeScript. As such, it needs to compile before the code runs. The compilation creates a pause of approximately 2 minutes each time the HomeBridge service is started.
sudo service homebridge stop
sudo killall node
cd ~/Downloads/HAP-NodeJS
sudo ts-node --files src/BridgedCore.ts
HomeBridge common errors:
- The script reports 'HAP-NodeJS starting...' then hangs for up to 2 minutes before providing any text output - This is expected behaviour caused by the TypeScript code compiling before running.
-
Error: listen EADDRINUSE: address already in use - This is caused by a second instance of the service still running in the background. Use
sudo killall node
to stop the second instance, then re-run the service as a script.
Copy new image on SD card. Move SD card to Raspberry Pi Boot on Raspberry Pi - image now fills entire disk Shutdown Raspberry Pi
Move SD card back to Windows device... Use Computer management | Disk management to find the Disk number Open VMware player Select Debian device Select Edit virtual machine settings Add... hard disk (next) Select IDE (next) Select Use a physical disk (for advanced users) From the dropdown, select the disk number (next) Click Finish Click OK
Start the Virtual machine Run GPARTED (requires Root credentials) Change device to /dev/sdb Resize (shrink) partition to 4096 MB From the menu bar, select Edit | Apply all operations
Right click and check partition (this is required to set START and END points correctly) From the menu bar, select Edit | Apply all operations
Create new Extended partition From the menu bar, select Edit | Apply all operations
Create new Logical partition - ext4 From the menu bar, select Edit | Apply all operations
Close GPARTED and Shut down Virtual machine
Move SD card back to Rasp Pi
From a terminal session run 'blkid' to find ID for new partition (usually /dev/mncblk0p5) sudo mkdir -p /mnt/media sudo mount -o defaults /dev/mmcblk0p5 /mnt/media ( temp mount )
Permanent mount... blkid - then record the PARTUUID info
sudo nano /etc/fstab
PARTUUID=6c586e13-05 /mnt/media ext4 defaults 0 2
Reboot df -h ( Check if disk available )
Edit /etc/samba/smb.conf to create new data share...
add a section similar to...
[media]
comment = Data directory
path = /mnt/media
browseable = yes
guest ok = no
read only = no
valid users = pi, root
Visit the website oddwires.co.uk