Apologies for starting a topic and just posting a link. I had typed this whole story as a topic here, but it wouldn’t let me post it because I’m a “new user”. So, here goes:
Long story short, I’ve spent the last two days jailbreaking the Somfy Connexoon to get it to work without the need for an internet connection or Somfy account. I succeeded, soft of, but I’m unable to test any further because I don’t have any devices to connect to it yet .
The reason I wanted to share this with you is to see if:
This project is interesting to anyone and if I should contintue to make it production ready
If there is anyone who can give me some tips and / or pointes about the “pairing mode”
There is anyone who can offer me some help in general.
I did try a search on the forum, but all of the posts that I found were talking about using the cloud version of the Somfy API’s, not the local ones.
Please let me know if this isn’t the intended way of sharing information. Again, I had wanted to post it here without external links but it didn’t allow me to do so.
No, this is a different service altogether, with its own authentication mechanism. Once you get SSH access you can get a token by running this command:
I suspect that there is an alternative way to do it, but I wasn’t able to find it (yet). The reason I think that is that as soon as you start the “local” service it starts broadcasting its presence via mDNS over the network. There are also some open UDP ports. My guess would be that you need a mobile app to set it up in that case, but I haven’t had any luck finding it.
I’ve already talked with @imick on Discord and he gave me some pointers. When I have some free time I’ll have a go at some proof-of-concept code.
First of all great work.
I’m allways in for some hacking but i’m not a programmer or something, and i do’nt like cloud solutions either.
Do you think, when i use your guide to “root” the software, the orignally functions to somfy will still keep working? Now we are using the official HA addon to control the 2 blinds via the somfy cloud.
It woul be nice to experiment with the “open” variant of yours, while the somfy variant will still be working.
No, the local API seems crippled on purpose. Whatever you do you cannot seem to add new devices. Another option would be to snuff the DBUS messages but my Connexoon was un-rooted by an update and haven’t gotten around to re-rooting it.
Okay so I put some more time into this. I tweaked the Tahoma integration a bit to allow for communication with the local API:
It can now talk to the connexoon over HTTP directly to its local IP address without the need for any sort of cloud:
I’ve also gotten several questions from people wanting to know how exactly you modify the firmware once you extract it (see my blog for instructions on that). No guarantees but here are my notes on that:
mkdir ubi-root
mkdir ubi-rootB
mkdir extract
sudo modprobe nandsim first_id_byte=0xec second_id_byte=0xa1 third_id_byte=0x00 fourth_id_byte=0x15;
sudo flash_erase /dev/mtd0 0 0
sudo nandwrite /dev/mtd0 ubi-volume.bin
sudo modprobe ubi
sudo ubiattach -p /dev/mtd0 -O 2048
sudo mount -t ubifs -o rw /dev/ubi0_7 ubi-root
sudo mount -t ubifs -o rw /dev/ubi0_9 ubi-rootB
cd ubi-root/etc/rc5.d
sudo ln -s ../init.d/dropbear S06dropbear
cd ubi-root/etc/rc2.d
sudo ln -s ../init.d/dropbear S06dropbear
cd ubi-rootB/etc/rc5.d
sudo ln -s ../init.d/dropbear S06dropbear
cd ubi-rootB/etc/rc2.d
sudo ln -s ../init.d/dropbear S06dropbear
edit etc/shadow -> add root hash (both root and rootB)
sudo umount ubi-root
sudo umount ubi-rootB
for i in {0..10}; do name=$(ubinfo -d 0 -n $i | grep Name | awk '{print $2}'); sudo dd if=/dev/ubi0_$i of=extract/$name.bin; done
cd extract
for i in {0..5}; do name=$(ubinfo -d 0 -n $i | grep Name | awk '{print $2}');size=$(ubinfo -d 0 -n $i | grep Size | cut -d '(' -f 2 | cut -d ' ' -f 1); echo -en "[$name]\nmode=ubi\nimage=$name.bin\nvol_id=$i\nvol_size=$size\nvol_type=static\nvol_name=$name\nvol_alignment=1\n\n"; done > config.ini
for i in {6..10}; do name=$(ubinfo -d 0 -n $i | grep Name | awk '{print $2}');size=$(ubinfo -d 0 -n $i | grep Size | cut -d '(' -f 2 | cut -d ' ' -f 1); echo -en "[$name]\nmode=ubi\nimage=$name.bin\nvol_id=$i\nvol_size=$size\nvol_type=dynamic\nvol_name=$name\nvol_alignment=1\n\n"; done >> config.ini
ubinize -o ../ubi-volume_patched.bin -p 131072 -m 2048 -O 2048 -s 512 -Q 1056559212 config.ini
cd ..
sudo umount /dev/ubi0_*
sudo ubidetach -p /dev/mtd0
sudo rmmod ubifs ubi nandsim
./sam-ba_3.5/sam-ba -p usb -b sam9xx5-ek -a lowlevel
./sam-ba_3.5/sam-ba -p usb -b sam9xx5-ek -a extram
./sam-ba_3.5/sam-ba -p usb -b sam9xx5-ek -a nandflash:::0xc0902405 -c erase:0x20000 -c write:ubi-volume_patched.bin:0x20000 -c verify:ubi-volume_patched.bin:0x20000
Not quite sure where to go from here to be honest :).
I recently used the guide to root mij connexoon and it is working.
The old way, via the somfy cloud also keeps working, it’s a sort of hybrid situation.
Just a small tip, edit the /etc/hosts file and add:
127.0.0.1 ha-upgrade.overkiz.com
127.0.0.1 ha-update.overkiz.com
Because else, the somfy cloud server will update and overwrite your rooted firmware and you will loose the root.
Another tip, when you reboot the connexoon or you power cycle it, you have to do again:
mount -o remount,rw /
rm /etc/lighttpd.d/ssl.conf
/etc/init.d/webserver start
/etc/init.d/local start
So i make a start.sh file in /etc/init.d and symlinked it in /etc/rc2.d and /etc/rc5.d and name it S99start symlinked to …/init.d/start.sh
Hi, thanks for posting about it. I also went down that route a while ago but I had not much successs controling my deives localy. They always went offline a few seconds after beeing controlled by homeassistant.
There’s currently a bug in the local version of the python tahoma API library that’s causing this disconnect. I’ll drop a message here when it’s been adressed
Disclaimer: I did the absolute bare minimum in order to make this work. Because of that I probably introduced other weird bugs. Don’t rely on this for production use