Logic Machine Forum
SpaceLYnk Telegram - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: SpaceLYnk Telegram (/showthread.php?tid=2509)



SpaceLYnk Telegram - adiaz - 12.03.2020

Hi,

We have Telegram API working on LogicMachines. We copy the same code on SpaceLynk and it not works..

Is posible to make it work on SpaceLynk?

Thanks!


RE: SpaceLYnk Telegram - Joep - 12.03.2020

Check your network settings. Make sure you have a working internet connection at your spaceLYnk. If it can't communicate to the internet it can't communicate with the API or if it's a local device make sure your spaceLYnk is in the same network as your API device (like Philips Hue gridge or so).


RE: SpaceLYnk Telegram - adiaz - 12.03.2020

Network is OK.

Code used is:

local telegram_url = 'https://api.telegram.org/'..token_bot..'/sendMessage?'

function telegram(message)

  local data_str = 'chat_id=' .. chat_id .. '&text=' .. message..''

  local res, code, headers, status = ssl.https.request(telegram_url, data_str)

log (res,code,headers,status) 
 
end


Log Response:

* arg: 1
  * nil
* arg: 2
  * string: error:1409442E:lib(20):func(148):reason(1070)
* arg: 3
  * nil
* arg: 4
  * nil


Not working!
Thanks!