Timeline for pigpio library serial_wave confusion
Current License: CC BY-SA 4.0
12 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Dec 14, 2018 at 20:47 | comment | added | Zack Jackson | WOW i figured it out. i was send bb_bits = 32 when it should = 8. it is working now. Thanks for helping me work through this.! | |
| Dec 14, 2018 at 20:39 | comment | added | Zack Jackson | I added print(pkt) and print(type(pkt)) to my script and that returns bytearray(b'\xff\x01\x02\x01\x01\x00\x04d') and <class 'bytearray'> andi checked with piscope i added my script for sending cmd, my sniffer, and a screenshot of the piscope to my original post above. | |
| Dec 14, 2018 at 20:13 | comment | added | joan | Would have to see all the code to comment. | |
| Dec 14, 2018 at 20:01 | comment | added | Zack Jackson | strange my code is pkt = bytearray(b'\xff\x01\x02\x01\x01\x00\x04d') send_command(pkt) but when i run the sniffer bb_serial_read(gpio) tells me that bytearray(b'\x01 \xc0') is being sent | |
| Dec 14, 2018 at 19:38 | comment | added | joan | The start/stop bits are added by wave_add_serial function. Use the sniffer you used before to check what is being sent. | |
| Dec 14, 2018 at 18:34 | comment | added | Zack Jackson | is there something im missing about the pigpio wave_send_once()? | |
| Dec 14, 2018 at 18:33 | comment | added | Zack Jackson | ok so i have made some progress. i setup a script to sniff the that my peripheral device i receiving from its actuall commercial controller(tablet). when i use the tablet to tell the device to turn off pump. the sniffer prints a bytearray(b'\xff\x01\x02\x01\x01\x00\x04d'). however when i use my above code to send the same command ie pkt = bytearray(b'\xff\x01\x02\x01\x01\x00\x04d') the device doesnt work properly. I thought it might be bc of the start bit you mentioned above so i removed the \xff from pkt but this does not work. does the wave_send_once() auto generate the start/end bytes?@joan | |
| Dec 6, 2018 at 16:53 | comment | added | joan | Each number has a start bit and an end bit. That is used to allow synchronisation between sender and receiver. E.g. see ece.northwestern.edu/local-apps/matlabhelp/techdoc/… | |
| Dec 6, 2018 at 16:28 | comment | added | Zack Jackson | im still not completely undertstanding how this works. you sent the packet [0xaa,0xaa,0xaa]. I would think this would be 24 bits therefore 2496usec, however when i look at the screenshot and output of picsope when i run it. it looks like there are 28bits therefore 2912usec. Am i missing something? what are the extra 4 bits? | |
| Dec 4, 2018 at 14:18 | vote | accept | Zack Jackson | ||
| Dec 4, 2018 at 14:18 | comment | added | Zack Jackson | I understand that i will not see the line toggle if there is no level change. what i realized is that if i send the packet in an array like in your example, i.e. packet = [0x03] , i see the expected output. Before when i was sending the packet, i was sending it as a string. i.e. packet = '3'. This is when i did not see what was expected. I think this might have to do with the way python stores string variables. I will have to investigate further. Thanks for your help and thanks for your awesome pigpio! | |
| Nov 30, 2018 at 20:00 | history | answered | joan | CC BY-SA 4.0 |