Neues Modul: Signalbot (Integration für den Signal Messenger) via signal-cli

Begonnen von Adimarantis, 31 Januar 2021, 19:16:19

Vorheriges Thema - Nächstes Thema

memento_10

Aber sicher doch. Hier das Log, die message ist ohnehin enthalten:

2024.04.17 17:29:46 1: message: <tt>Heutige Strompreise:</tt> <br><code>00:00 - 01:00  11.84 ct/kWh </code><br><code>01:00 - 02:00  14.81 ct/kWh </code><br><code>02:00 - 03:00  19.86 ct/kWh </code><br><code>03:00 - 04:00  20.68 ct/kWh </code><br><code>04:00 - 05:00  17.25 ct/kWh </code><br><code>05:00 - 06:00  13.04 ct/kWh </code><br><code>06:00 - 07:00  11.95 ct/kWh </code><br><code>07:00 - 08:00  13.10 ct/kWh </code><br><code>08:00 - 09:00  12.05 ct/kWh </code><br><code>09:00 - 10:00  11.64 ct/kWh </code><br><code>10:00 - 11:00  11.25 ct/kWh </code><br><code>11:00 - 12:00  11.99 ct/kWh </code><br><code>12:00 - 13:00  12.12 ct/kWh </code><br><code>13:00 - 14:00  16.44 ct/kWh </code><br><code>14:00 - 15:00  21.00 ct/kWh </code><br><code>15:00 - 16:00  18.02 ct/kWh </code><br><code>16:00 - 17:00  14.30 ct/kWh </code><br><code>17:00 - 18:00  12.40 ct/kWh </code><br><code>18:00 - 19:00  11.47 ct/kWh </code><br><code>19:00 - 20:00  11.05 ct/kWh </code><br><code>20:00 - 21:00  10.78 ct/kWh </code><br><code>21:00 - 22:00  10.23 ct/kWh </code><br><code>22:00 - 23:00  10.16 ct/kWh </code><br><code>23:00 - 24:00  10.52 ct/kWh </code><br>
2024.04.17 17:29:46 3: Signal: Before parse:#Smarthome <tt>Heutige Strompreise:</tt> <br><code>00:00 - 01:00 11.84 ct/kWh </code><br><code>01:00 - 02:00 14.81 ct/kWh </code><br><code>02:00 - 03:00 19.86 ct/kWh </code><br><code>03:00 - 04:00 20.68 ct/kWh </code><br><code>04:00 - 05:00 17.25 ct/kWh </code><br><code>05:00 - 06:00 13.04 ct/kWh </code><br><code>06:00 - 07:00 11.95 ct/kWh </code><br><code>07:00 - 08:00 13.10 ct/kWh </code><br><code>08:00 - 09:00 12.05 ct/kWh </code><br><code>09:00 - 10:00 11.64 ct/kWh </code><br><code>10:00 - 11:00 11.25 ct/kWh </code><br><code>11:00 - 12:00 11.99 ct/kWh </code><br><code>12:00 - 13:00 12.12 ct/kWh </code><br><code>13:00 - 14:00 16.44 ct/kWh </code><br><code>14:00 - 15:00 21.00 ct/kWh </code><br><code>15:00 - 16:00 18.02 ct/kWh </code><br><code>16:00 - 17:00 14.30 ct/kWh </code><br><code>17:00 - 18:00 12.40 ct/kWh </code><br><code>18:00 - 19:00 11.47 ct/kWh </code><br><code>19:00 - 20:00 11.05 ct/kWh </code><br><code>20:00 - 21:00 10.78 ct/kWh </code><br><code>21:00 - 22:00 10.23 ct/kWh </code><br><code>22:00 - 23:00 10.16 ct/kWh </code><br><code>23:00 - 24:00 10.52 ct/kWh </code><br>:
2024.04.17 17:29:46 4: Signal: sendGroupMessage called for Smarthome::𝙷𝚎𝚞𝚝𝚒𝚐𝚎 𝚂𝚝𝚛𝚘𝚖𝚙𝚛𝚎𝚒𝚜𝚎:
00:00 - 01:00 11.84 𝚌𝚝/𝚔𝚆𝚑
01:00 - 02:00 14.81 𝚌𝚝/𝚔𝚆𝚑
02:00 - 03:00 19.86 𝚌𝚝/𝚔𝚆𝚑
03:00 - 04:00 20.68 𝚌𝚝/𝚔𝚆𝚑
04:00 - 05:00 17.25 𝚌𝚝/𝚔𝚆𝚑
05:00 - 06:00 13.04 𝚌𝚝/𝚔𝚆𝚑
06:00 - 07:00 11.95 𝚌𝚝/𝚔𝚆𝚑
07:00 - 08:00 13.10 𝚌𝚝/𝚔𝚆𝚑
08:00 - 09:00 12.05 𝚌𝚝/𝚔𝚆𝚑
09:00 - 10:00 11.64 𝚌𝚝/𝚔𝚆𝚑
10:00 - 11:00 11.25 𝚌𝚝/𝚔𝚆𝚑
11:00 - 12:00 11.99 𝚌𝚝/𝚔𝚆𝚑
12:00 - 13:00 12.12 𝚌𝚝/𝚔𝚆𝚑
13:00 - 14:00 16.44 𝚌𝚝/𝚔𝚆𝚑
14:00 - 15:00 21.00 𝚌𝚝/𝚔𝚆𝚑
15:00 - 16:00 18.02 𝚌𝚝/𝚔𝚆𝚑
16:00 - 17:00 14.30 𝚌𝚝/𝚔𝚆𝚑
17:00 - 18:00 12.40 𝚌𝚝/𝚔𝚆𝚑
18:00 - 19:00 11.47 𝚌𝚝/𝚔𝚆𝚑
19:00 - 20:00 11.05 𝚌𝚝/𝚔𝚆𝚑
20:00 - 21:00 10.78 𝚌𝚝/𝚔𝚆𝚑
21:00 - 22:00 10.23 𝚌𝚝/𝚔𝚆𝚑
22:00 - 23:00 10.16 𝚌𝚝/𝚔𝚆𝚑
23:00 - 24:00 10.52 𝚌𝚝/𝚔𝚆𝚑

2024.04.17 17:29:46 5: Signal: getGroup Smarthome
2024.04.17 17:29:46 5: Signal: Dbus Call sync:0 sendGroupMessage(sasay) /org/asamk/Signal/_4367xxxxxxxxx Args:𝙷𝚎𝚞𝚝𝚒𝚐𝚎 𝚂𝚝𝚛𝚘𝚖𝚙𝚛𝚎𝚒𝚜𝚎:
00:00 - 01:00 11.84 𝚌𝚝/𝚔𝚆𝚑
01:00 - 02:00 14.81 𝚌𝚝/𝚔𝚆𝚑
02:00 - 03:00 19.86 𝚌𝚝/𝚔𝚆𝚑
03:00 - 04:00 20.68 𝚌𝚝/𝚔𝚆𝚑
04:00 - 05:00 17.25 𝚌𝚝/𝚔𝚆𝚑
05:00 - 06:00 13.04 𝚌𝚝/𝚔𝚆𝚑
06:00 - 07:00 11.95 𝚌𝚝/𝚔𝚆𝚑
07:00 - 08:00 13.10 𝚌𝚝/𝚔𝚆𝚑
08:00 - 09:00 12.05 𝚌𝚝/𝚔𝚆𝚑
09:00 - 10:00 11.64 𝚌𝚝/𝚔𝚆𝚑
10:00 - 11:00 11.25 𝚌𝚝/𝚔𝚆𝚑
11:00 - 12:00 11.99 𝚌𝚝/𝚔𝚆𝚑
12:00 - 13:00 12.12 𝚌𝚝/𝚔𝚆𝚑
13:00 - 14:00 16.44 𝚌𝚝/𝚔𝚆𝚑
14:00 - 15:00 21.00 𝚌𝚝/𝚔𝚆𝚑
15:00 - 16:00 18.02 𝚌𝚝/𝚔𝚆𝚑
16:00 - 17:00 14.30 𝚌𝚝/𝚔𝚆𝚑
17:00 - 18:00 12.40 𝚌𝚝/𝚔𝚆𝚑
18:00 - 19:00 11.47 𝚌𝚝/𝚔𝚆𝚑
19:00 - 20:00 11.05 𝚌𝚝/𝚔𝚆𝚑
20:00 - 21:00 10.78 𝚌𝚝/𝚔𝚆𝚑
21:00 - 22:00 10.23 𝚌𝚝/𝚔𝚆𝚑
22:00 - 23:00 10.16 𝚌𝚝/𝚔𝚆𝚑
23:00 - 24:00 10.52 𝚌𝚝/𝚔𝚆𝚑
,ARRAY(0x616e768),ARRAY(0x6148aa0)
2024.04.17 17:29:47 5: Signal: DBus callback: sendGroupMessage Args:1713367786990
2024.04.17 17:29:49 5: Signal: Sync Callback: ReceiptReceived Args:1713367786990,+4367xxxxxxxx
2024.04.17 17:29:49 5: Signal: Signalbot_receive_callback 1713367786990 +4367xxxxxxxx
FHEM auf Rpi4, OpenWRT auf Netgear Nighthawk, CUL868, FHT80, Tradfri, CUL433, tbot, alexa-fhem, ESP8266, Shelly 1+2, homebridge, Klingelerkennung über ESP, Anwesenheit per OpenWRT

Adimarantis

Und letztendlich geht es darum das die Zahlen nicht so richtig in monospace dargestellt werden?
Das liegt daran, dass ich wohl damals für die meisten Zahlen im Unicode nicht die richtigen Seiten gefunden habe.
Nach etwas Recherche finde ich für monospace Zahlen bei 0x1d7f6

Hab ein Update für Unicode.pm in svn eingecheckt.


Raspberry 4 + HM-MOD-RPI-PCB (pivCCU) + RfxTrx433XL + 2xRaspberry 1
Module: 50_Signalbot, 52_I2C_ADS1x1x , 58_RPI_1Wire, (50_SPI_MAX31865)

memento_10

Hi!

Vielen Dank für Deine Unterstützung.
Ich habe die Änderung (manuell) durchgeführt. Sollte ein 'update all' oder 'update Unicode.pm' nicht die Änderungen ziehen? 

Auf jeden Fall funktioniert es jetzt wie erwartet, vielen Dank nochmal!

Schöne Grüße!
Simon

FHEM auf Rpi4, OpenWRT auf Netgear Nighthawk, CUL868, FHT80, Tradfri, CUL433, tbot, alexa-fhem, ESP8266, Shelly 1+2, homebridge, Klingelerkennung über ESP, Anwesenheit per OpenWRT

HarryT

Hi

I have an issue with signal.

Top reports continuously a 100% cpu use.
    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                                                                                                                                 
   1001 signal-+  20   0 3901284 173772  23424 S 100,0  18,7  60:03.34 java                                                                                                                                    
   1049 fhem      20   0  137812 121544  10752 S   7,6  13,1   5:18.98 perl

My signal.service is:
[Unit]
Description=Send secure messages to Signal clients
Requires=dbus.socket
After=dbus.socket
Wants=network-online.target
After=network-online.target
   
[Service]
Type=dbus
Environment="SIGNAL_CLI_OPTS=-Xms2m"
Environment="JAVA_HOME=/opt/java"
ExecStart=/opt/signal/bin/signal-cli --config /var/lib/signal-cli daemon --system
User=signal-cli
BusName=org.asamk.Signal
   
[Install]
WantedBy=multi-user.target
Alias=dbus-org.asamk.Signal.service

I installed signal with the signal_install.sh script:
SCRIPTVERSION="3.26"

I use raspberry OS 64 bit dd 15-3-2024.

This happens also when I install everything, including OS, clean again and run it on a raspberry pi 3 or raspberry pi 4. (And restore my settings with signal_install.sh restore) 

Everything works fine, and "systemctl status signal" reports nothing strange.
 
I have seen high cpu usages before, but this was fixed with "systemctl restart signal". A restart doesn´t fix it now. Neither does a reboot.

Is this a "normal" behavior or is there something on my installation which triggers this? 
What can be wrong and any idea how to fix this?
 
FHEM 6.3 auf Raspberry Pi3  (1,2 Ghz)
RFXTRX433XL, ZWave, KFL200 and ConBeeIII
Raspberry Pi1 (0,7 Ghz) and Raspberry Pi4 for testing
German reading skills are good.

Adimarantis

Hi Harry,

no, that's not normal. My signal-cli does not use any CPU (0-1%) when it's idling.
How much memory do you have? Java eats a lot, that why I'm running my environment on a 4GB Raspberry 4, but I'm also running a number of additional services on it.
Though swapping due to memory shortage should also not push CPU to 100%
Have you checked the system logfiles (that's where signal-cli is putting its logging) for any weird activity. You should only see entries there if you actually send messages.
As you're on 64bit I assume you're on Debian 12+ where /var/log/syslog does not longer exist and you need to so something like
journalctl -u signal.service -fThat will "follow" the logfile and only print new lines on activitiy.

Jörg
Raspberry 4 + HM-MOD-RPI-PCB (pivCCU) + RfxTrx433XL + 2xRaspberry 1
Module: 50_Signalbot, 52_I2C_ADS1x1x , 58_RPI_1Wire, (50_SPI_MAX31865)

HarryT

Hi Jörg

Zitat von: Adimarantis am 22 April 2024, 09:35:12no, that's not normal. My signal-cli does not use any CPU (0-1%) when it's idling.
How much memory do you have? Java eats a lot, that why I'm running my environment on a 4GB Raspberry 4, but I'm also running a number of additional services on it.
Though swapping due to memory shortage should also not push CPU to 100%

My raspberrypi3 has 1 Gb and the raspberrypi4 has 8 gb. So memory should not be the problem. Top also reports just 16 % memory usage.

ZitatHave you checked the system logfiles (that's where signal-cli is putting its logging) for any weird activity. You should only see entries there if you actually send messages.
As you're on 64bit I assume you're on Debian 12+ where /var/log/syslog does not longer exist and you need to so something like
journalctl -u signal.service -fThat will "follow" the logfile and only print new lines on activitiy.

I did not before. I checked it now and I see about every 90 seconds:
apr 22 15:10:35 Debi12-12 signal-cli[62699]: Envelope from: "Harry Txxxxxx" +316xxxxxxxx (device: 1) to +31xxxxxxx
apr 22 15:10:35 Debi12-12 signal-cli[62699]: Timestamp: 1713542493395 (2024-04-19T16:01:33.395Z)
apr 22 15:10:35 Debi12-12 signal-cli[62699]: Server timestamps: received: 1713597075434 (2024-04-20T07:11:15.434Z) delivered: 1713789651584 (2024-04-22T12:40:51.584Z)
apr 22 15:10:35 Debi12-12 signal-cli[62699]: Sent by unidentified/sealed sender
apr 22 15:10:35 Debi12-12 signal-cli[62699]: Exception: org.signal.libsignal.protocol.InvalidMessageException: invalid Whisper message: decryption failed (ProtocolInvalidMessageException)

Strange as I get the message once without problems.

I checked this on the internet but I didn´t see other people with this issue the last few years. The last mention is from 2019 in https://ctrl.alt.coop/en/post/signal-without-a-smartphone/
When I try to use this solution I run in the problems with the java-version.

Any ideas about the problem and how to solve it?

Thanks in advance
FHEM 6.3 auf Raspberry Pi3  (1,2 Ghz)
RFXTRX433XL, ZWave, KFL200 and ConBeeIII
Raspberry Pi1 (0,7 Ghz) and Raspberry Pi4 for testing
German reading skills are good.

Adimarantis

Didn't find anything useful either.
In one older article I found, they were talking about issues with the keys between the two devices.
It might help to re-register one or both of signal-cli and the counterpart you're using.
Others suggested that it would go away after a backlog of faulty messages is processed, but it seems permanent for you.

If it's not too much of a hassle, I would really reset signal-cli (stop it, delete the content of /var/log/signal-cli, then start again) and re-register your number.
If that does not help, you might even want to do the same with the counterpart (from: number) that produces those message. If it sounds easier you could even try that first.

Jörg
Raspberry 4 + HM-MOD-RPI-PCB (pivCCU) + RfxTrx433XL + 2xRaspberry 1
Module: 50_Signalbot, 52_I2C_ADS1x1x , 58_RPI_1Wire, (50_SPI_MAX31865)

HarryT

Zitat von: Adimarantis am 22 April 2024, 17:38:12If it's not too much of a hassle, I would really reset signal-cli (stop it, delete the content of /var/log/signal-cli, then start again) and re-register your number.
If that does not help, you might even want to do the same with the counterpart (from: number) that produces those message. If it sounds easier you could even try that first.


I don´t have a directory signal-cli on my /var/log/  and can't find anything anywhere with such a name. Is it moved?
BTW don´t bother about hassles. I have a test system for it and my whole installation is scripted. So it is easy to try something. 

FHEM 6.3 auf Raspberry Pi3  (1,2 Ghz)
RFXTRX433XL, ZWave, KFL200 and ConBeeIII
Raspberry Pi1 (0,7 Ghz) and Raspberry Pi4 for testing
German reading skills are good.

Adimarantis

Sorry I mistyped: /var/lib/signal-cli

You might want to archive it before removing, though.

Raspberry 4 + HM-MOD-RPI-PCB (pivCCU) + RfxTrx433XL + 2xRaspberry 1
Module: 50_Signalbot, 52_I2C_ADS1x1x , 58_RPI_1Wire, (50_SPI_MAX31865)

HarryT

Zitat von: Adimarantis am 22 April 2024, 20:09:49Sorry I mistyped: /var/lib/signal-cli

Ok. I tried replacing the setting with the backuped setting from 2 years ago using signal_install restore.  It seemed to work , but after a while the cpu usages went up again.

Unfortunately I now have nwe problems. I get: 
signal-cli[999]: WARN  ReceiveHelper - Connection closed unexpectedly, reconnecting in 100 ms

This happens on my test system AND on my production system where nothing is changed. BUT I used the same settings on both environments.

Does this mean more trouble or just wait till tomorrow so the system can fix itself?

FHEM 6.3 auf Raspberry Pi3  (1,2 Ghz)
RFXTRX433XL, ZWave, KFL200 and ConBeeIII
Raspberry Pi1 (0,7 Ghz) and Raspberry Pi4 for testing
German reading skills are good.

HarryT

Zitat von: HarryT am 22 April 2024, 21:24:02Unfortunately I now have nwe problems. I get: 
signal-cli[999]: WARN  ReceiveHelper - Connection closed unexpectedly, reconnecting in 100 ms

This happens on my test system AND on my production system where nothing is changed. BUT I used the same settings on both environments.


Does this mean more trouble or just wait till tomorrow so the system can fix itself?



Ok, this one was easy. It is because I run 2 clients on the same account.

Now it seems I have
apr 22 15:10:35 Debi12-12 signal-cli[62699]: Sent by unidentified/sealed sender
apr 22 15:10:35 Debi12-12 signal-cli[62699]: Exception: org.signal.libsignal.protocol.InvalidMessageException: invalid Whisper message: decryption failed (ProtocolInvalidMessageException)
sometimes and sometimes not.

I am trying to find what triggers it and what fixes it.

Would it make sense to try newer libraries?
FHEM 6.3 auf Raspberry Pi3  (1,2 Ghz)
RFXTRX433XL, ZWave, KFL200 and ConBeeIII
Raspberry Pi1 (0,7 Ghz) and Raspberry Pi4 for testing
German reading skills are good.

Adimarantis

If your problems don't go away, I would really recommend deleting everything and go thru the registration process of your number from scratch.
signal-cli has been changing a lot in the configuration data and if you have not been updating on a regular basis, there is a chance the the "jump" in the version was too big to correctly migrate it.

Also of course use the latest version of signal-cli.
I'm currently testing 0.13.3 in my systems. It's looking good. So I will publish the update to the installer later today.
Raspberry 4 + HM-MOD-RPI-PCB (pivCCU) + RfxTrx433XL + 2xRaspberry 1
Module: 50_Signalbot, 52_I2C_ADS1x1x , 58_RPI_1Wire, (50_SPI_MAX31865)