Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
WebInput en HTTPS ne marche pas ?
#1
Question 
Salut a tous,

Depuis longtemps j'utilise les WebInput sans probleme, par exemple en accedant au JSON d'OpenWeatherMap avec une url HTTP comme decrit sur le wiki.

Aujourd'hui j'essaie pour la premiere fois d'acceder a un JSON dont l'url est en HTTPS au lieu d'HTTP et ca ne semble pas marcher, j'ai une valeur zero qui est retournee a chaque fois. Comme OpenWeatherMap est aussi accessible en HTTPS, j'ai essaye et j'ai le meme probleme, ca ne marche pas en HTTPS mais ca marche en HTTP.  Est-ce normal ?


Voici les logs dans le cas ou ca marche en HTTP (input_64 est correct) :

Code:
Aug 07 15:57:48 raspberrypi calaos_server[452]: [INF] input (InputTemp.cpp:120) input_64: 23 °C
Aug 07 15:57:48 raspberrypi calaos_server[452]: [INF] server (CalaosConfig.cpp:276) State cache file written successfully (/home/root/.cache/calaos/iostates.cache)
Aug 07 15:57:31 raspberrypi calaos_server[452]: [ERR] websocket (WebSocket.cpp:508) Can't send data, websocket is not connected
Aug 07 15:57:31 raspberrypi calaos_server[452]: [ERR] websocket (WebSocket.cpp:508) Can't send data, websocket is not connected
Aug 07 15:57:31 raspberrypi calaos_server[452]: [ERR] websocket (WebSocket.cpp:508) Can't send data, websocket is not connected
Aug 07 15:57:31 raspberrypi calaos_server[452]: [ERR] websocket (WebSocket.cpp:508) Can't send data, websocket is not connected
Aug 07 15:57:31 raspberrypi calaos_server[452]: [ERR] websocket (WebSocket.cpp:508) Can't send data, websocket is not connected
Aug 07 15:57:31 raspberrypi calaos_server[452]: [ERR] websocket (WebSocket.cpp:508) Can't send data, websocket is not connected
Aug 07 15:57:31 raspberrypi calaos_server[452]: [ERR] websocket (WebSocket.cpp:508) Can't send data, websocket is not connected
Aug 07 15:57:31 raspberrypi calaos_server[452]: [ERR] websocket (WebSocket.cpp:508) Can't send data, websocket is not connected
Aug 07 15:57:31 raspberrypi calaos_server[452]: [ERR] websocket (WebSocket.cpp:508) Can't send data, websocket is not connected
Aug 07 15:57:31 raspberrypi calaos_server[452]: [ERR] websocket (WebSocket.cpp:508) Can't send data, websocket is not connected
Aug 07 15:57:31 raspberrypi calaos_server[452]: [ERR] websocket (WebSocket.cpp:508) Can't send data, websocket is not connected
Aug 07 15:57:31 raspberrypi calaos_server[452]: [ERR] websocket (WebSocket.cpp:508) Can't send data, websocket is not connected
Aug 07 15:57:31 raspberrypi calaos_server[452]: [INF] input (InputAnalog.cpp:115) input_70: 0
Aug 07 15:57:31 raspberrypi calaos_server[452]: [INF] input (InputAnalog.cpp:115) input_68: 70
Aug 07 15:57:31 raspberrypi calaos_server[452]: [INF] input (InputAnalog.cpp:115) input_67: 1.5
Aug 07 15:57:31 raspberrypi calaos_server[452]: [INF] input (InputAnalog.cpp:115) input_66: 1018
Aug 07 15:57:31 raspberrypi calaos_server[452]: [INF] input (InputAnalog.cpp:115) input_65: 43
Aug 07 15:57:31 raspberrypi calaos_server[452]: [WRN] rule.condition.standard (ConditionStd.cpp:147) get_value(int) not int !
Aug 07 15:57:31 raspberrypi calaos_server[452]: [INF] input (InputTemp.cpp:120) input_64: 23 °C
Aug 07 15:56:48 raspberrypi calaos_server[452]: [ERR] websocket (WebSocket.cpp:508) Can't send data, websocket is not connected
Aug 07 15:56:48 raspberrypi calaos_server[452]: [ERR] websocket (WebSocket.cpp:508) Can't send data, websocket is not connected
Aug 07 15:56:48 raspberrypi calaos_server[452]: [ERR] websocket (WebSocket.cpp:508) Can't send data, websocket is not connected


Voici les logs dans le cas ou ca marche pas en HTTPS (input_64=0) :

Code:
Aug 07 16:08:40 raspberrypi calaos_server[1947]: [INF] input (InputTemp.cpp:120) input_64: 0 °C
Aug 07 16:08:40 raspberrypi calaos_server[1947]: [INF] server (CalaosConfig.cpp:276) State cache file written successfully (/home/root/.cache/calaos/iostates.cache)
Aug 07 16:08:30 raspberrypi calaos_server[1947]: [INF] websocket (WebSocket.cpp:443) Received a PONG back in 00:00.0003
Aug 07 16:08:26 raspberrypi calaos_server[1947]: [INF] input (InputTemp.cpp:120) input_93: 22.75 °C
Aug 07 16:08:15 raspberrypi calaos_server[1947]: [INF] websocket (WebSocket.cpp:443) Received a PONG back in 00:00.0002
Aug 07 16:08:00 raspberrypi calaos_server[1947]: [INF] websocket (WebSocket.cpp:443) Received a PONG back in 00:00.0003
Aug 07 16:07:45 raspberrypi calaos_server[1947]: [INF] websocket (WebSocket.cpp:443) Received a PONG back in 00:00.0003
Aug 07 16:07:41 raspberrypi calaos_server[1947]: [INF] input (InputTemp.cpp:120) input_92: 23.75 °C
Aug 07 16:07:40 raspberrypi calaos_server[1947]: [INF] input (InputAnalog.cpp:115) input_70: 0
Aug 07 16:07:40 raspberrypi calaos_server[1947]: [INF] input (InputAnalog.cpp:115) input_68: 100
Aug 07 16:07:40 raspberrypi calaos_server[1947]: [INF] input (InputAnalog.cpp:115) input_67: 2.6
Aug 07 16:07:40 raspberrypi calaos_server[1947]: [INF] input (InputAnalog.cpp:115) input_66: 1018
Aug 07 16:07:40 raspberrypi calaos_server[1947]: [INF] input (InputAnalog.cpp:115) input_65: 41
Aug 07 16:07:40 raspberrypi calaos_server[1947]: [WRN] rule.condition.standard (ConditionStd.cpp:147) get_value(int) not int !
Aug 07 16:07:40 raspberrypi calaos_server[1947]: [INF] input (InputTemp.cpp:120) input_64: 0 °C
Aug 07 16:07:40 raspberrypi calaos_server[1947]: [INF] input (InputAnalog.cpp:115) input_70: 0
Aug 07 16:07:40 raspberrypi calaos_server[1947]: [INF] input (WebInputString.cpp:84) Read string value : ciel dégagé
Aug 07 16:07:40 raspberrypi calaos_server[1947]: [INF] input (InputAnalog.cpp:115) input_68: 100
Aug 07 16:07:40 raspberrypi calaos_server[1947]: [INF] input (InputAnalog.cpp:115) input_67: 2.6
Aug 07 16:07:40 raspberrypi calaos_server[1947]: [INF] input (InputAnalog.cpp:115) input_66: 1018
Aug 07 16:07:40 raspberrypi calaos_server[1947]: [INF] input (InputAnalog.cpp:115) input_65: 41
Aug 07 16:07:40 raspberrypi calaos_server[1947]: [WRN] rule.condition.standard (ConditionStd.cpp:147) get_value(int) not int !
Aug 07 16:07:40 raspberrypi calaos_server[1947]: [INF] input (InputTemp.cpp:120) input_64: 0 °C
Aug 07 16:07:40 raspberrypi calaos_server[1947]: [INF] server (CalaosConfig.cpp:276) State cache file written successfully (/home/root/.cache/calaos/iostates.cache)
Aug 07 16:07:30 raspberrypi calaos_server[1947]: [INF] websocket (WebSocket.cpp:443) Received a PONG back in 00:00.0002
  calaos-os-raspberrypi2-v3.0-alpha6-14-g341535a-2021-01-17 on Raspberry Pi 2 ▶ Wago_2.2/wago_881.pro on Wago 750-881 ▶ DS18B20 sensors on Pi GPIO ▶ Node-RED









Reply
#2
Hmm, non c'est pas normal... Je vais tester ca.
Raoul,
Calaos Core Dev.
Calaos git sur NUC NUC5PPYH | Wago 750-849 | DALI RGB | Sondes NTC sur 750-464 | Sondes 1Wire DS18B20 avec adaptateur USB DS9490R | Nodes MySensors avec gateway USB | Ecran tactile ELO avec adaptateur USB/RS232 | Squeezebox Duet et Radio | Logitech Harmony Ultimate | Ampli Pioneer VSX921
Reply
#3
Tu as deja eu l'occasion de tester Raoul ?

J'ai ajoute les logs dans mon 1er post si ca peut aider. La seule chose que je remarque ce sont les "Received a PONG back" dans le cas ou ca marche pas.
  calaos-os-raspberrypi2-v3.0-alpha6-14-g341535a-2021-01-17 on Raspberry Pi 2 ▶ Wago_2.2/wago_881.pro on Wago 750-881 ▶ DS18B20 sensors on Pi GPIO ▶ Node-RED









Reply
#4
Sous quelle version tu es sur ton rpi?
Raoul,
Calaos Core Dev.
Calaos git sur NUC NUC5PPYH | Wago 750-849 | DALI RGB | Sondes NTC sur 750-464 | Sondes 1Wire DS18B20 avec adaptateur USB DS9490R | Nodes MySensors avec gateway USB | Ecran tactile ELO avec adaptateur USB/RS232 | Squeezebox Duet et Radio | Logitech Harmony Ultimate | Ampli Pioneer VSX921
Reply
#5
Derniere version : calaos-os-raspberrypi-v3.0-alpha4-0-g4625f1b-2017-04-01
  calaos-os-raspberrypi2-v3.0-alpha6-14-g341535a-2021-01-17 on Raspberry Pi 2 ▶ Wago_2.2/wago_881.pro on Wago 750-881 ▶ DS18B20 sensors on Pi GPIO ▶ Node-RED









Reply
#6
hmmm... en fait il faut l'alpha5, mais j'ai pas encore fait de build...
Je vais voir ca.
Raoul,
Calaos Core Dev.
Calaos git sur NUC NUC5PPYH | Wago 750-849 | DALI RGB | Sondes NTC sur 750-464 | Sondes 1Wire DS18B20 avec adaptateur USB DS9490R | Nodes MySensors avec gateway USB | Ecran tactile ELO avec adaptateur USB/RS232 | Squeezebox Duet et Radio | Logitech Harmony Ultimate | Ampli Pioneer VSX921
Reply
#7
J'ai fait une alpha5 pour raspberry pi, tu peux tester?
Raoul,
Calaos Core Dev.
Calaos git sur NUC NUC5PPYH | Wago 750-849 | DALI RGB | Sondes NTC sur 750-464 | Sondes 1Wire DS18B20 avec adaptateur USB DS9490R | Nodes MySensors avec gateway USB | Ecran tactile ELO avec adaptateur USB/RS232 | Squeezebox Duet et Radio | Logitech Harmony Ultimate | Ampli Pioneer VSX921
Reply
#8
Voila j'ai essaye avec l'alpha5 mais ca marche pas.

Si tu veux tester, voici un input de io.xml.  Avec l'url en HTTP ca marche  mais si on met HTTPS dans l'url ca marche pas (ca renvoie une string vide).

Code:
<calaos:input enabled="true" file_type="json" frequency="60000" gui_type="string_in" id="input_1000" io_type="input" name="Test json" path="total" type="WebInputString" url="https://data.public.lu/api/1/datasets/" visible="true" />

A noter que le site redirige l'url HTTP vers HTTPS donc je suis encore plus etonne que ca marche en mettant l'url HTTP et pas HTTPS.

Log avec HTTPS (journalctl -ru calaos-server):

Code:
Aug 15 23:52:44 raspberrypi calaos_server[592]: [INF] server (IOFactory.cpp:51) webinputstring: Ok
Aug 15 23:52:44 raspberrypi calaos_server[592]: [INF] input (WebInputString.cpp:72) Frequency : 60000
Aug 15 23:52:44 raspberrypi calaos_server[592]: [INF] input (WebInputString.cpp:84) Read string value :
Aug 15 23:52:44 raspberrypi calaos_server[592]: [INF] input (WebInputString.cpp:63) WebInputString::WebInputString()
Aug 15 23:52:44 raspberrypi calaos_server[592]: [INF] input (InputString.cpp:35) input_1000: Ok
Aug 15 23:52:44 raspberrypi calaos_server[592]: [INF] server (IOFactory.cpp:51) wodigital: Ok
Aug 15 23:52:44 raspberrypi calaos_server[592]: [INF] server (IOFactory.cpp:51) wodigital: Ok
  calaos-os-raspberrypi2-v3.0-alpha6-14-g341535a-2021-01-17 on Raspberry Pi 2 ▶ Wago_2.2/wago_881.pro on Wago 750-881 ▶ DS18B20 sensors on Pi GPIO ▶ Node-RED









Reply
#9
C'est bizarre.

calaos_server utilise curl pour faire le download. Essaye de le lancer en ligne de commande pour voir:

curl -v --insecure --location https://data.public.lu/api/1/datasets/

Ca devrait te retourner le json
Raoul,
Calaos Core Dev.
Calaos git sur NUC NUC5PPYH | Wago 750-849 | DALI RGB | Sondes NTC sur 750-464 | Sondes 1Wire DS18B20 avec adaptateur USB DS9490R | Nodes MySensors avec gateway USB | Ecran tactile ELO avec adaptateur USB/RS232 | Squeezebox Duet et Radio | Logitech Harmony Ultimate | Ampli Pioneer VSX921
Reply
#10
Sur mon Pi la commande curl retourne bien le meme json en HTTP et HTTPS.
  calaos-os-raspberrypi2-v3.0-alpha6-14-g341535a-2021-01-17 on Raspberry Pi 2 ▶ Wago_2.2/wago_881.pro on Wago 750-881 ▶ DS18B20 sensors on Pi GPIO ▶ Node-RED









Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)