• 10 dec 2017: forum version update. In case of issues use this topic.
  • 30 nov 2017: pilight moved servers. In case of issues use this topic.
Hello There, Guest! Login Register


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Issue send actions over Socket API in AdHoc network
#1
Dear all,

I've been using pilight for min. 3 years now and so far for every issue that I came across I was able to find a solution by reading the manual or someone had posted a solution on the forum. However, this time I couldn't find a solution for my rather exotic issue.

In order to have batter coverage I'd moved to an adhoc setup which is working well in general. As long as I use the REST API or the build in WebIf to switch my devices everything works as it's supposed to.


Sample http request: pi:5001/send?protocol=pollin&on=1&systemcode=9&unitcode=2&uuid=0000-b8-27-eb-dffca2

The uuid is important here. If it's not provided the socket will not switch. This is a known fact and not my issue.

The actual issue is that I'm not able to switch my devices using the Socket API. Also, I've noticed that the uuid parameter is not documented as part of the action object. I believe if the uuid could be passed over via the Socket API it would solve my issue. On the WebIf the switches change when I send  the Socket message, but my device doesn't switch.

The version of pilight I'm running here is 8.1.4 from the nightly repo.

Any advice would be welcome.

Regards
G.
 
Reply
#2
Can you try switching the sockets using pilight-send while passing the UUID parameter?
 
Reply
#3
(02-27-2019, 09:53 PM)curlymo Wrote: Can you try switching the sockets using pilight-send while passing the UUID parameter?

That doesn't work either. The WebIf recognizes the switch, but the pollin device doesn't.
Switching with the WebIf, Android app or via http works fine though.
 
Reply
#4
To be on one line. What's WebIf?
 
Reply
#5
WebIf = the web interface - the build in web server of pilight.
 
Reply
#6
The webserver translates those REST API calls to socket messages as well, so i'm amazed it doesn't work.

Here are the relevant lines:
https://github.com/pilight/pilight/blob/...#L582-L654
 
Reply
#7
Let me get this straight sending requests over REST API works fine.
Quote:pi:5001/send?protocol=pollin&on=1&systemcode=9&unitcode=1&uuid=0000-b8-27-eb-dffca2
Code:
// 20190303160749
// h t t p://pi:5001/send?protocol=pollin&on=1&systemcode=9&unitcode=1&uuid=0000-b8-27-eb-dffca2

{
 "message": "success"
}



However, sending a message like this example to port tcp 5000 doesn't.


Code:
{  "action": "send",  "code": { "protocol": [ "pollin" ],    "systemcode": 9,    "unitcode": 2,   "on": 1   } }

I get the reply

Code:
{"status":"success"}

But nothing happens.
I had no success sending this kind of messages in an AdHoc setup.
It works well in a single instances setup. 

The same result with pilight-send. Executing this command
Code:
pilight-send -S=127.0.0.1 -P=5000 -p=pollin -s=9 -u=1 --on --uuid=0000-b8-27-eb-dffca2
pilight-send -S=127.0.0.1 -P=5000 -p=pollin -s=9 -u=1 --off --uuid=0000-b8-27-eb-dffca2
flicks the switch on the web interface but no reaction from my device.

Pressing the button on the web interface works fine.
 
Reply
#8
This is something i need to dig deeper into.
 
Reply
#9
This issue should be fixed now in the latest nightly.
 
Reply
#10
Latest nightly seems to not work with adhoc settings.
At my system the pilight-daemon debug tells me „connection to pilight daemon lost“ and is going into an infinite „trying to reconnect“-loop.
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  Send pulsestream via API Phunkafizer 19 443 02-27-2019, 09:54 PM
Last Post: curlymo
  pilight-send and pilight-daemon DieterK 0 409 06-20-2018, 12:44 AM
Last Post: DieterK
  AdHoc network with 2 Raspberry and 2 GPIO transmitter not working webdandy 29 5,386 09-06-2017, 02:39 PM
Last Post: wseifert
  BUG: BMP180 in AdHoc Network Alex 5 1,370 06-19-2016, 02:24 PM
Last Post: Alex
  AdHoc network with different senders Mr.Montesa 6 2,465 02-11-2016, 01:29 PM
Last Post: Karel
  Switching ceiling fan with pilight-send -p raw gadget 4 2,369 01-12-2016, 07:39 PM
Last Post: eunger
  cannot bind to the ssdp multicast network wo_rasp 1 2,712 09-22-2015, 12:10 PM
Last Post: curlymo
  Disable adhoc network? heikoh81 5 3,195 09-17-2015, 09:01 PM
Last Post: heikoh81
  Sending with 2 transmitters (AdHoc) tobid 11 3,896 08-23-2015, 05:12 PM
Last Post: curlymo
  AdHoc - Defining MainDaemon tobid 18 7,507 08-12-2015, 07:41 AM
Last Post: gregnau

Forum Jump:


Browsing: 1 Guest(s)