• 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
  pilight error after update to 8.1.5 on Odroid C2 WitchDoctor 3 77 11-29-2019, 09:56 PM
Last Post: curlymo
  pilight crashing randomly PatiB 7 248 11-16-2019, 10:50 PM
Last Post: curlymo
  [Fixed] RaspberryPi4 pilight 8.1.5 - Send isn't working DominikB1993 4 278 10-18-2019, 10:25 PM
Last Post: DominikB1993
  Real 433Mhz Remote is disturbed by pilight service henne111 2 297 10-06-2019, 06:18 PM
Last Post: wo_rasp
Tongue (solved) pilight 8.1.5-1-gc0a175e0 Chrashes fleisch 5 734 10-03-2019, 01:15 PM
Last Post: fleisch
  Starting pilight on boot: "cannot bind to the SSDP multicast network" pilino1234 4 508 09-29-2019, 02:08 PM
Last Post: tomk
  pilight for Raspbian Buster (raspberry pi 4) ? starob 29 3,252 07-15-2019, 08:45 PM
Last Post: curlymo
  pilight-receive Filteroption not working Alex 2 668 07-14-2019, 08:35 AM
Last Post: Alex
  pilight 8.1.4 crashes after some hours Ulrich.Arnold 47 3,198 06-29-2019, 08:58 PM
Last Post: curlymo
  Raspberry PI, gpio-ir-tx and pilight not starting lordslash 5 1,035 06-11-2019, 05:19 PM
Last Post: curlymo

Forum Jump:


Browsing: 1 Guest(s)