ole1986 / centronic-py

Centronic USB Stick to control Becker Shutter CC31/CC51
43 stars 10 forks source link

problems with training #13

Closed fredmoro closed 3 years ago

fredmoro commented 3 years ago

Hello.

I'm triyng to train my becker blinds, using a centronic stick and this code under home assistant, on a raspberry PI 4. The code seems run without errors. My problem is that when I try to train, using the master transmitter (it's an EC545-II remote), holding the pair button for 3 sec, then the blind clicks once, then I run the train command - here I should hear another click from the motor - but no second click. The train command displays some lines with codes, and then I can see the database changed - the device seems trained - but I cannot move it up or down... What did I miss? Shall I power-cycle the motor, before training? (eg. resetting the motor's counter) (I haven't tried it yet, because it's a bit difficult, since there is no separated circuit breaker for the motors, so I can't shut them down one-by-one )

I've noticed that my device name differs from the mentioned default name. (but I think it's not a problem, since the code recognizes correctly the stick, no error is thrown. My device's name is: /dev/serial/by-id/usb-BECKER-ANTRIEBE_GmbH_B_MONITOR_v125-if00

Even if I start a listen with -l parameter, it doesn't display any messages when I'm pressing the buttons on the remote... So what can be the problem?? please help...

ole1986 commented 3 years ago

Maybe the stick itself? Do you have further details about the stick.

When he listen mode is activated it should actually display the codes when you use the remote.

Maybe the blinds are incompatible with the stick?

fredmoro commented 3 years ago

The stick looks like a plain USB stick, as I seen on the photos. I also suspected the stick. It's a new one, bought from a vendor, who installed the blinds - i think it should be ok. I disassembled it, there was a barcode sticker inside: '671574100246 V2.5'

I tried the stick on a windows 10 machine, recognized and mapped to COM4.

Is it possible that it has newer firmware on it, where usability has been restricted to Becker systems only and the possibility of using it on other systems has been locked out?

Maybe the blinds are incompatible with the stick?

I have older P5-C01 Becker motors (from 2016), with EC545-II remote controllers - they should be compatible I think...

fredmoro commented 3 years ago

Hello!

I ave an idea... Maybe my stick is a newer one or something, and therefore the Stick ID can be different. The sript uses 0000000002010B. Te technical MD says: Stick to accept submission of the code Is required for USB Stick Otherwise not signal sent - so if this code differs in my case, then I need my sticks correct ID to have a chance to do anything with it.

If this is the case, then how can I get the correct code?

My stick has a number OUTSIDE on the stick: 40352000410 - this is the article number. could You please check Yours? And when I disassembled, it has another code INSIDE: 671574100246 and V2.5 - i think it must be some kind of serial number...

I also tried with a new and 'virgin' P9-C01 motor, and new remote... but no success.

fredmoro commented 3 years ago

HI!

I think I found the proble. If I open a terminal session to it (under windows), and I typed some characters to it.. The device responded, when pressing 'h': [h]Help_[i]Init_[m]Mode. Pressing 'm', it respoinds: 0x03, and if I press 'i', it responds: RepeaterV1.25. So it seems that it's a repeater device (I think it's identical with the normal Centronic stick, but maybe it has a repeater firmware on it. That's why it didn't worked...

Is there a way to update the firmware in it ? What do you think?

ole1986 commented 3 years ago

That is pretty good what you found out. I never had the chance to get further details on the firmware or even update it.

ole1986 commented 3 years ago

When I enter h or I i do not get any response.

I only get the responses when pressing the remotes once connected to the port

Do you have any manual for your stick or how do you know about such commands

fredmoro commented 3 years ago

So, Your one dumps out the messages from the remotes? Mine only displays these 3 things, and no messages.. Unfortunately there wasn't anything for it, just the stick itself... I will try to contact Becker about the possibility of a firmware change, but I think there is a 99% chance that the request will be denied - or not possible. The other option is to ask the vendor to change the stick to the right one. I'll keep You informed...

ole1986 commented 3 years ago

In the below forum you may find several details about the code

https://forum.fhem.de/index.php/topic,53756.165.html

fredmoro commented 3 years ago

Hi! Thanks for the link, I studied that forum, but I'm afraid it won't help me with this stick. However can it work without the centronic stick? Using SIGNALDuino? That seems the only way, as thing standing now: I got answer from Becker.As I expected, they refused to give any information about the stick, in addition they stated that it was considered hacking! Outrageous! I got an information piece about the stick: it can act as a router, but can be used as a transmitter too if plugged in becker CCxx unit. So, I think, the CCxx unit itself makes a change, when attached to it, during initialization, or it simply updates it's firmware silently, etc... I think if we could send the right command to it, to switch mode and start acting as a transmitter - but we don't know the code...

So, it seems that I'll have to look after other other solution, eg. using of SIGNALDuino.

And a warning to others: recent sticks' firmware seems to permit using them only with Becker's own CCxx units.

ole1986 commented 3 years ago

I also worked on getting it to run with signalduino. What I found out was the random code being generated.

Also this code can then be resent to the blinds after a reset (e.g. by cutting off the power supply)

But I was never able to get any response from the shutter. The reason I think was the bad signal quality of the nanoCUL using FSK modulation.

But it's been a while since I tried it and maybe the firmware for the nanoCUL has become better.

More details about the RAW signal can be found here:

https://forum.fhem.de/index.php/topic,110043.0.html

And here:

https://github.com/ole1986/centronic-py/blob/master/TECHNICAL.md#receive-raw-signal-using-fhem

fredmoro commented 3 years ago

Hello.

I could dowmload the system image of the central control, and could extract the files from it. Not surprisingly it's a Linux OS. The files in the package mentioned some "centronic pro stick", and there was a .uf2 file, which I believe the stick's firmware... But I'm not a Linux guru, so a specialist may find out something more... There is a script for updating the stick with this firmware. I tried to run it, but no success. The script theoretically sends a code to the stick, which puts the stick in bootloader mode, then it flashes the new firmware.... As I understand the script...

If you wish, I can upload it somewhere, to have a look at it...

ole notifications@github.com ezt írta (időpont: 2020. dec. 16., Sze 6:39):

I also worked on getting it to run with signalduino. What I found out was the random code being generated.

Also this code can then be resent to the blinds after a reset (e.g. by cutting off the power supply)

But I was never able to get any response from the shutter. The reason I think was the bad signal quality of the nanoCUL using FSK modulation.

But it's been a while since I tried it and maybe the firmware for the nanoCUL has become better.

More details about the RAW signal can be found here: https://forum.fhem.de/index.php/topic,110043.0.html

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ole1986/centronic-py/issues/13#issuecomment-745777403, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOH7EOOZP7GIABAL24DH43TSVBB2HANCNFSM4UVWP53A .

ole1986 commented 3 years ago

Yes, please provide me a link to download. Also feel free to give instruction on how you have extracted and what the script name was you tried to execute.

Thank you in advanced

EDIT: For completeness, please provide the official download link (if applicable and does not violate any rights)

fredmoro commented 3 years ago

Well, the extracting of the package surely wouldn't be approved. but the download method is 100% official.

  1. Download the offline updater, from becker - it's a windows exe
  2. The updater is designed to download the CC51 or CC31 system update file to a removable device (USB, SD, etc.).
  3. the downloaded files include a file, named rootfs.ubi. You have to extract it with eg. using UBI reader
  4. The command looks someting like this: ubireader_extract_files. <rootfs.ubi path> -o <extraction path>
  5. The extracted file system has some interesting files:

    extraction path\118459354\rootfs\opt\cc51\ under lib subfolder there is the firmware image I mentioned: cplus-0137.uf2. It's an UF2 file format, used for flashing devices. There are some 40 character codes can be found in this file, near the end - but it's a packed format, so mostly unreadable... The bin subfolder contains a cpupd.sh script, which looks like to used to update the stick's firmware with the above mentioned .uf2 firmware file.

What I'm not entirely sure is this centronic plus stick is identical to that stick I have. The centronic plus name isn't mentioned elsewhere... The stick appears under /sys/bus/usb/devices/, where the idVendor:2638 - this match with the sript, but idProduct in my case 0013 - the original script searches 0030 idProduct - that's why I think, it can be different somehow, so be careful!

The benefit of all could be, if You could put your stick to bootloader mode, and extract the firmware from it. Then I (and maybe others in the future) could flash their stick with a working firmware.

I modified the script to: UPDFILE= to point directly to the firmware file and CENTRONIC_PLUS_ID= to match my stick's ID: 2638:0013

In this case, it found the stick, but exited with error: Cannot find Block device after switch to bootloader

That's all I could find out so far...

ole1986 commented 3 years ago
# My centronic stick
Bus 001 Device 007: ID 2638:0013
fredmoro commented 3 years ago

Maybe i'm doing something wrong, and the device itself is ok? What do we miss? But there is the difference, that mine responds to terminal messages i, h and m.. .yours not. And my one doesn't print the codes to the console as yours...

Edit: I tried to use it with home assistant, on a raspberry pi 4. I think it should work, because I have some other similar serial-usb devices, those working without problems. Eg. zigbee CC2531 stick from texas instruments, and another USB 485 serial port. (I also tried the centronic stick alone, without other usb devices, and tried using a powered hub - nothing changed) Edit2: For terminal I used windows and putty, 9600 baud rate (but baud rate doesn't matter I think)

ole1986 commented 3 years ago

The firmware version can be gathered through the bcdDevice. Mine is showing the following

# one liner to fetch centronic stick version
for u in /sys/bus/usb/devices/*; do [ -e $u/idVendor ] && [ $(cat "$u/idVendor")  = "2638" ] && echo "Centronic stick found in $u with productid $(cat $u/idProduct) and version: $(cat $u/bcdDevice)" ; done
# output
Centronic stick found in /sys/bus/usb/devices/1-1.2 with productid 0013 and version: 0125

So I assume my version does not contain the router feature?! What about your version?

EDIT

In addition to this (and due to the fact Product ID is not 0030) the script will respond with "Centronic Plus Stick not found". So, I assume there is a "Plus" Centronic stick at the market which I do not own

By knowing this the firmware"cplus-0137.uf2" seem to be exclusively for such "Plus" sticks

fredmoro commented 3 years ago

Yes, that firmware can be for something different device (I tried to find some info about it, but found nothing...)

Running the 1 line command responds the same output, as yours. So it seems the stick is the same, and firmware is the same as I see.. But if i look at the /dev/serial/by-id folder, there the stick appears like this: usb-BECKER-ANTRIEBE_GmbH_B_MONITOR_v125-if00 and yours?

However if I open it with the following command, I can type the mentioned characters: h, m and i - and the stick responds: screen /dev/ttyACM0 15200,cs8 eg. pressing I gets: RepeaterV1.25 EDIT: Can You try this, see if yours respond anything? Also pressing remote buttons produce output, when opened this way? my one doesn't produce any output for the remote signals...

I have a feeling that it should work, and I messed up something... But what am I doing wrong? Was your stick ever plugged in a CentralControl unit?

ole1986 commented 3 years ago

What if yours is nothing else than a repeater do simply boost the signal?

It would have make sense. What if we both open the sticks and make some pictures from the inside to see if a firmware may solve your problems?

Of course only if you do not mind about warranty (if applicable)

fredmoro commented 3 years ago

Photos Meanwhile I started a buyback procedure, but haven't got any answer yet... But I would be happier if I could use it properly rather than change it back. I don't really want to do the task by "raping" a remote, like this :)

fredmoro commented 3 years ago

I tried the repeater function: it definitely boosted the signal. I tried to operate motors from the basement, there was no reception. When I powered the stick about half-ways to the motors, then there was good reception. So the stick's router function is working as expected.

ole1986 commented 3 years ago

While comparing the sticks I noted that only the "SX1236" chip is different. But TDA 5210 is the identical.

It also looks like the newer "Centronic Plus" stick has the ability to receive firmware updates from the CC51 unit while older sticks seem to not support it.

So, questions here are:

fredmoro commented 3 years ago

Now I'm focusing the executables in the opt/bin directory. They can be executed on a raspberry 2. I could run the stick tool, but apparently does nothing important... Trying the others soon... There is a problem running centronic-py on it, because this distro has latest python 3.5... cannot update to higher python, therefore makes a bit difficult to test... now trying dist upgrade...

ole notifications@github.com ezt írta (időpont: 2020. dec. 16., Sze 15:26):

While comparing the sticks I noted that only the "SX1236" chip is different. But TDA 5210 is the identical.

It also looks like the newer "Centronic Plus" stick has the ability to receive firmware updates from the CC51 unit while older sticks seem to not support it.

So, questions here are:

  • How to get the firmware which is supposed to be the non-monitoring one (like the one I have)
  • How to flash your stick with it

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ole1986/centronic-py/issues/13#issuecomment-746373510, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOH7EOPS5275N3MANF3DLPDSVC7RFANCNFSM4UVWP53A .

ole1986 commented 3 years ago

I just got the centronic-test executable to run on my rasberry pi (while chrooted the rootfs of course). This tool is nothing else than centronic-stick.py -l. But of course it contains the correct description of the command Very interesting!

/opt/cc51/bin # ./centronic-test 
opened centronic stick at /dev/ttyACM0.
0b0000000000xxxx f0210000004043 (43; 00) (OK) Simple         xxxxf0 EXECUTE,NOSC Group 0 (Simple) DOWN,
0b0000000000xxxx f0210000000083 (83; 00) (OK) Simple         xxxxf0 EXECUTE,NOSC Group 0 (Simple) 
0b0000000000xxxx f0210000001073 (73; 00) (OK) Simple         xxxxf0 EXECUTE,NOSC Group 0 (Simple) STOP,
0b0000000000xxxx f0210000000083 (83; 00) (OK) Simple         xxxxf0 EXECUTE,NOSC Group 0 (Simple) 
0b0000000000xxxx f0210000002063 (63; 00) (OK) Simple         xxxxf0 EXECUTE,NOSC Group 0 (Simple) UP,
0b0000000000xxxx f0210000000083 (83; 00) (OK) Simple         xxxxf0 EXECUTE,NOSC Group 0 (Simple) 

0b0000000000xxxx d021020f0018e5 (e5; 1e) (Fixup) Clock          xxxxd0 EXECUTE,NOSC Group 15 (All) SHIFT,STOP,
0b0000000000xxxx c021020f0018f5 (f5; 1e) (Fixup) Clock          xxxxc0 EXECUTE,NOSC Group 15 (All) SHIFT,STOP,
0b0000000000xxxx d021020f0008f5 (f5; 1e) (Fixup) Clock          xxxxd0 EXECUTE,NOSC Group 15 (All) SHIFT,
gregg-ai commented 3 years ago

Hello, I encounter the same issue with my Centronic USB key. When I connect to the key using screen followed by I the version is RepeaterV1.26 So, impossible to TRAIN any receiver.

I have the CC51 with an old Centronic USB key. When I launch the screen command on this key, nothing is displayed when I enter 'h' or any other keystroke.

I tried to do a manual update of the CC51 with the new key plugged into the CC51. But nothing change and the key remains as Repeater. Have you done any progress from your side ?

ole1986 commented 3 years ago

At the moment I can only tell that two different Centronic USB devices are available on market. The "old" one (where you do not see "RepeaterV1.26") seem to be the working one.

But that does not mean that the new one is not working. It is just switched to repeater mode by default. We are still investigating to switch the USB devices back to transmission mode.

@fredmoro maybe you have something new for us about this topic?

fredmoro commented 3 years ago

Wow! If I understand correctly, you have a cc51 controller with an "old" stick, and a new stick. So if you plug in the new stick to the cc51, then it should be able to use it as the old one. Have you tried it? I had a theory, that the CC51 updates its firmware, or if not updating, at least it sends a special command to it, to tell the stick how to work. It can be a temporary effect for the new stick, eg. it lasts only till powered up, and switch back to repeater, when you disconnect from the cc51.

So please try the new stick with the cc51, and try to pair some motors with it. If I'm right, it should work as the old one, until it's connected to the cc51... If this is the case, then we only have to somehow sniff the magic command...

Regards, F

ole notifications@github.com ezt írta (időpont: 2020. dec. 28., H 16:18):

At the moment I can only tell that two different Centronic USB devices are available on market. The "old" one (where you do not see "RepeaterV1.26") seem to be the working one.

But that does not mean that the new one is not working. It is just switched to repeater mode by default. We are still investigating to switch the USB devices back to transmission mode.

@fredmoro https://github.com/fredmoro maybe you have something new for us about this topic?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ole1986/centronic-py/issues/13#issuecomment-751746916, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOH7EOK4Y6NJ46TCVDWBY23SXCOV5ANCNFSM4UVWP53A .

gregg-ai commented 3 years ago

Hi Ole and Fremoro, Thanks for your fast feedback. Yes have a CC51 with an old Centronic stick (2013) and a new one. I already swapped the Centronic sticks in the CC51. Tested to run down / up a roller, but nothing append on roller side. I forced the update of the CC51 with the 03/12/2020 version, but the new Centronic stick remains in repeater mode with 1.26 version. Tomorrow morning, I will try to pair with the new stick into CC51 and I will post the result. Regards, Greg

fredmoro commented 3 years ago

Hello All!

I've just played with sending some ascii characters to the "new" stick. I found, if I send "$" - it responds "SrartBOOTLOADER" - so I think it's a trace. Only I don't really know what should I do with it after all. Seems nothing change following this... Any idea? EDIT: uhh, if I power-cycled the device, it doesn't appear anymore as serial device... So DON'T do it! In windows, it appears as HID bootloader device.... but no serial port belongs to it....

ole1986 commented 3 years ago

@fredmoro I am sorry to hear that... Unless you do net get this back to "normal" I think without reprogramming (through a PICKit) it is broken. Since this IC is damn small (I think its PLCC) you need to be dam tough soldering the connectors to use such PICKit, too

fredmoro commented 3 years ago

So, it seems that the stick switched to bootloader mode, and stuck in it :(. No further power-cycles helped, so couldn't switch back to normal operation... yet. There are contact points on the back side - maybe those can be used to communicate with it. But I think, there must be a way to change back from bootloader mode. eg. some kind of reset shorting certain legs oft the chip or something...

ole1986 commented 3 years ago

I might have a chance to use some of the resets provided by the chip. This is the related datasheet btw. https://ww1.microchip.com/downloads/en/DeviceDoc/30005009c.pdf

Chapter 7.0 might give you some options

UPDATE: some explanation about the different reset modes - https://www.sprut.de/electronic/pic/reset/index.htm (in german)

fredmoro commented 3 years ago

I need to change the bootloader mode, to boot "normaly". I think normal resets won't help... but I'm completly newbie about PICs :)

trying to download MPLABX from microchip, but always get a corrupted installer. Well, it would be nice to win from here :D

ole1986 commented 3 years ago

I also think without a pickit connected to the IC (somehow) you won't have a chance either...

We are running out of the primary ticket issue. Let us discuss further things through email please..

gregg-ai commented 3 years ago

From my side, I tried to connect the new key with ref. 4035 200 0490 into the CC51. I tried to action a motor -> failed I tried to pair -> failed I tried to run Centronic USB reset in Setting menu -> failed Swap with the initial centronic key and action motor -> failed !!!!! I was afraid to (re)pair my 15 motors...I do a backup restore from setting menu and I get back working the initial Centronic key and CC51 with motors. So I decided to contact Becker through contact form. Bed news for fredmoro :-( I hope you don't brick your key.... We continue discussions through email.

ole1986 commented 3 years ago

@gregg-ai sorry but I did not get which stick is working and which is not.

UPDATE

Now I got it - gregg-ai took the previous USB device (the one from 2013) and had to restore the backup. The backup restore I think is mostly related to the CC51 software I assume.

Since the USB device is pretty unknown about units and incremental values it requires some place to get stored. And I think while you added the new usb device into the CC51 this configuration got lost

Allow me two further questions

ole1986 commented 3 years ago

Please discuss further things related to different Centronic USB Sticks in discussion thread #14 @gregg-ai feel free to join that discussion