• 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
pilight usb nano format conversion
#1
I am trying to send Raw codes captured via pilight from before via OpenMQTTGateway, under the hood it uses pilight.
Reading through the code I tracked down this required format that needs to be passed for raw transmission.

Code:
See file here
https://github.com/pilight/pilight-usb-nano/blob/master/pilight_usb_nano.c

// Code formatting meant for sending
// on  c:102020202020202020220202020020202200202200202020202020220020202203;p:279,2511,1395,9486;r:5@
// off c:102020202020202020220202020020202200202200202020202020202020202203;p:279,2511,1395,9486;r:5@


The raw code that works for me looks like this

Code:
216 744 240 744 240 744 720 264 240 744 720 264 240 768 240 744 720 264 720 288 240 744 240 744 720 264 720 264 720 264 720 264 720 264 240 744 240 768 216 768 720 288 696 264 720 264 720 264 720 288 696 288 216 768 216 768 720 288 696 288 696 288 696 264 216 8328


Is there a way to convert from my captured pilight raw code to the "code formatting" example in the pilight usb nano code?
 
Reply
#2
I found a discussion thread here that describes it.

I wrote some code to convert from my raw to the pulse train format, I tried sending it but still doesnt work.  

Code:
var rawcode = "207 736 253 736 253 736 736 253 253 736 736 253 253 736 253 736 736 253 713 253 253 713 253 759 713 276 713 276 713 276 713 276 736 253 253 736 253 736 253 736 713 276 230 736 736 253 736 276 713 276 713 276 230 759 253 759 736 253 230 736 253 736 253 736 230 8119"
var uniquecodes = [];
var pulsetrain = "c:";
var rawcodearray = rawcode.split(" ");
rawcodearray.forEach((number, index, array) => {

 let isLastItemInArray = (index === (array.length - 1));
 if(isLastItemInArray) {
   pulsetrain += ';p:' + uniquecodes.join(',') + ',' + number + '@';
 }
 else {
   if(!uniquecodes.includes(number)) {
     uniquecodes.push(number);
   }
   pulsetrain += uniquecodes.indexOf(number);  
 }
 
})


//example output c:00000000000100010101010002;p:370,670,11590@
console.log('Pulse train is:');
console.log(pulsetrain);
console.log('choo choo!');


If anyone can validate my conversion that would be great.  
I have an RTL-SDR running too so I am 100% sure something is getting transmitted, its just not working for the device I am targeting at the moment.
 
Reply
#3
Why not just check the source code of pilight itself?
https://github.com/pilight/pilight/blob/...33nano.lua
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
Tongue pilight 8.1.5-1-gc0a175e0 Chrashes fleisch 4 18 1 hour ago
Last Post: curlymo
  pilight for Raspbian Buster (raspberry pi 4) ? starob 29 1,332 07-15-2019, 08:45 PM
Last Post: curlymo
  pilight-receive Filteroption not working Alex 2 311 07-14-2019, 08:35 AM
Last Post: Alex
  pilight 8.1.4 crashes after some hours Ulrich.Arnold 47 1,762 06-29-2019, 08:58 PM
Last Post: curlymo
  Raspberry PI, gpio-ir-tx and pilight not starting lordslash 5 483 06-11-2019, 05:19 PM
Last Post: curlymo
  pilight fails starting on boot Alex 5 424 06-09-2019, 06:02 PM
Last Post: curlymo
  Google Assistant coupled to pilight hansrijn2 4 860 05-29-2019, 06:54 PM
Last Post: curlymo
  pilight-send does not stop (terminate) va13 3 422 05-15-2019, 06:06 PM
Last Post: curlymo
  oom_reaper: reaped process pilight-daemon va13 4 474 05-15-2019, 08:03 AM
Last Post: va13
  cant configure or even start pilight on raspi 3b Xvnx23 2 417 05-06-2019, 09:47 PM
Last Post: fourty2

Forum Jump:


Browsing: 1 Guest(s)