first try to send data with pi433 on Raspberry Pi

Marcin Ciupak marcin.s.ciupak at gmail.com
Tue Dec 12 21:33:50 UTC 2017


On Mon, Dec 11, 2017 at 10:29:54PM +0200, Marcus Wolf wrote:
> 
> Am 11.12.2017 um 20:40 schrieb Oliver Graute:
> > Hello list,
> > 
> > I just got my pi433 working somehow on Raspberry Pi Model B Rev 2.
> > 
> > Here are my findings:
> > 
> > first I need to enabling spi in config.txt on boot partition.
> > 
> > dtparam=spi=on
> > 
> > then adding this node to bcm2835-rpi-b-rev2.dts and compile.
> > 
> > &spi0_gpio7 {
> > 	pi433: pi433 at 0 {
> > 		compatible = "Smarthome-Wolf,pi433";
> > 		reg = <0>; /* CE 0 */
> > 		#address-cells = <1>;
> > 		#size-cells = <0>;
> > 		spi-max-frequency = <10000000>;
> > 
> > 		pinctrl-0 = <&pi433_pins>;
> > 		DIO0-gpio = <&gpio 24 0>;
> > 		DIO1-gpio = <&gpio 25 0>;
> > 		DIO2-gpio = <&gpio  7 0>;
> >          	status = "okay";
> > 	};
> > };
> > 
> > Then loading spi_bcm2835 and pi433 modules:
> > 
> > modprobe spi_bcm2835
> > modprobe pi433
> > 
> > Is this the right usage to send some data over the air?
> > 
> > echo 1 > /dev/pi433
> > 
> > [   31.223963] spi-bcm2835 20204000.spi: registered master spi0
> > [   31.224300] spi spi0.0: setup mode 0, 8 bits/w, 10000000 Hz max --> 0
> > [   31.224625] spi-bcm2835 20204000.spi: registered child spi0.0
> > [   31.224687] spi spi0.1: setup mode 0, 8 bits/w, 125000000 Hz max --> 0
> > [   31.224977] spi-bcm2835 20204000.spi: registered child spi0.1
> > [   34.062430] random: crng init done
> > [   43.122779] pi433: module is from the staging directory, the quality is unknown, you have been warned.
> > [   43.143436] pi433 spi0.0: setup mode 0, 8 bits/w, 10000000 Hz max --> 0
> > [   43.143465] pi433 spi0.0: spi interface setup: mode 0x 0, 8 bits per word, 10000000hz max speed
> > [   43.143587] pi433 spi0.0: found pi433 (ver. 0x24)
> > [   43.144027] pi433 spi0.0: DIO0 succesfully configured
> > [   43.144259] pi433 spi0.0: DIO1 succesfully configured
> > [   43.144274] pi433 spi0.0: set: mode
> > [   43.144387] pi433 spi0.0: read 0x4 from reg 0x1
> > [   43.144463] pi433 spi0.0: wrote 0x4 to reg 0x1
> > [   43.144476] pi433 spi0.0: set: data mode
> > [   43.144548] pi433 spi0.0: read 0x8 from reg 0x2
> > [   43.144617] pi433 spi0.0: wrote 0x8 to reg 0x2
> > [   43.144632] pi433 spi0.0: set: amp #0
> > [   43.144703] pi433 spi0.0: read 0x9f from reg 0x11
> > [   43.144772] pi433 spi0.0: wrote 0x9f to reg 0x11
> > [   43.144785] pi433 spi0.0: set: amp #1
> > [   43.144856] pi433 spi0.0: read 0x9f from reg 0x11
> > [   43.144923] pi433 spi0.0: wrote 0x9f to reg 0x11
> > [   43.144936] pi433 spi0.0: set: amp #2
> > [   43.145007] pi433 spi0.0: read 0x9f from reg 0x11
> > [   43.145074] pi433 spi0.0: wrote 0x9f to reg 0x11
> > [   43.145088] pi433 spi0.0: set: power level
> > [   43.145158] pi433 spi0.0: read 0x9f from reg 0x11
> > [   43.145225] pi433 spi0.0: wrote 0x9f to reg 0x11
> > [   43.145237] pi433 spi0.0: set: antenna impedance
> > [   43.145308] pi433 spi0.0: read 0x8 from reg 0x18
> > [   43.145376] pi433 spi0.0: wrote 0x8 to reg 0x18
> > [   43.145935] pi433 pi433: created device for major 244, minor 0
> > [   43.148742] pi433 pi433: thread: going to wait for new messages
> > 
> > Now I got hundreds messages of kind:
> > 
> > [   64.221295] pi433 pi433: write: generated new msg with 2 bytes.
> > 
> > snip
> > 
> > [   64.222671] pi433 pi433: write: generated new msg with 2 bytes.
> > [   64.223882] pi433 pi433: read 2 message byte(s) from fifo queue.
> > [   64.223919] pi433 spi0.0: set: mode
> > [   64.224010] pi433 spi0.0: read 0x4 from reg 0x1
> > [   64.224053] pi433 spi0.0: wrote 0x4 to reg 0x1
> > [   64.224064] pi433 spi0.0: set: fifo threshold
> > [   64.224100] pi433 spi0.0: read 0xf from reg 0x3c
> > [   64.224129] pi433 spi0.0: wrote 0xf to reg 0x3c
> > [   64.224159] pi433 spi0.0: 0 - 0x0
> > [   64.224170] pi433 spi0.0: set: payload length
> > [   64.224197] pi433 spi0.0: wrote 0x0 to reg 0x38
> > [   64.224209] pi433 spi0.0: set: frequency
> > [   64.224237] pi433 spi0.0: wrote 0x0 to reg 0x7
> > [   64.224263] pi433 spi0.0: wrote 0x0 to reg 0x8
> > [   64.224292] pi433 spi0.0: wrote 0x0 to reg 0x9
> > [   64.224303] pi433 spi0.0: set: bit rate
> > [   64.224331] pi433 spi0.0: wrote 0x1a to reg 0x3
> > [   64.224359] pi433 spi0.0: wrote 0x88 to reg 0x4
> > [   64.224370] pi433 spi0.0: set: modulation
> > [   64.224404] pi433 spi0.0: read 0x8 from reg 0x2
> > [   64.224431] pi433 spi0.0: wrote 0x8 to reg 0x2
> > [   64.224442] pi433 spi0.0: set: deviation
> > [   64.224450] pi433 spi0.0: set_deviation: illegal input param
> > [   64.224458] pi433 spi0.0: set: deviation
> > [   64.224466] pi433 spi0.0: set_deviation: illegal input param
> > [   64.224475] pi433 spi0.0: set: DIO mapping
> > [   64.224506] pi433 spi0.0: read 0x0 from reg 0x25
> > [   64.224537] pi433 spi0.0: wrote 0x0 to reg 0x25
> > [   64.224555] pi433 spi0.0: set: DIO mapping
> > [   64.224591] pi433 spi0.0: read 0x0 from reg 0x25
> > [   64.224618] pi433 spi0.0: wrote 0x0 to reg 0x25
> > [   64.224637] pi433 spi0.0: set: mode
> > [   64.224673] pi433 spi0.0: read 0x4 from reg 0x1
> > [   64.224702] pi433 spi0.0: wrote 0xc to reg 0x1
> > [   64.224718] pi433 pi433: thread: wait for packet to get sent/fifo to be empty
> > [   64.224728] pi433 pi433: thread: Packet sent. Set mode to stby.
> > [   64.224736] pi433 spi0.0: set: mode
> > [   64.224769] pi433 spi0.0: read 0x8 from reg 0x1
> > [   64.224799] pi433 spi0.0: wrote 0x4 to reg 0x1
> > [   64.224811] pi433 pi433: thread: going to wait for new messages
> > [   64.224824] pi433 pi433: read 2 message byte(s) from fifo queue.
> > [   64.224839] pi433 spi0.0: set: mode
> > [   64.224875] pi433 spi0.0: read 0x4 from reg 0x1
> > [   64.224904] pi433 spi0.0: wrote 0x4 to reg 0x1
> > [   64.224916] pi433 spi0.0: set: fifo threshold
> > [   64.224947] pi433 spi0.0: read 0xf from reg 0x3c
> > [   64.224976] pi433 spi0.0: wrote 0xf to reg 0x3c
> > [   64.225001] pi433 spi0.0: 0 - 0x0
> > [   64.225011] pi433 spi0.0: set: payload length
> > [   64.225041] pi433 spi0.0: wrote 0x0 to reg 0x38
> > [   64.225052] pi433 spi0.0: set: frequency
> > [   64.225078] pi433 spi0.0: wrote 0x0 to reg 0x7
> > [   64.225106] pi433 spi0.0: wrote 0x0 to reg 0x8
> > [   64.225133] pi433 spi0.0: wrote 0x0 to reg 0x9
> > [   64.225144] pi433 spi0.0: set: bit rate
> > [   64.225173] pi433 spi0.0: wrote 0x1a to reg 0x3
> > [   64.225200] pi433 spi0.0: wrote 0x88 to reg 0x4
> > [   64.225210] pi433 spi0.0: set: modulation
> > [   64.225242] pi433 spi0.0: read 0x8 from reg 0x2
> > [   64.225270] pi433 spi0.0: wrote 0x8 to reg 0x2
> > [   64.225281] pi433 spi0.0: set: deviation
> > [   64.225291] pi433 spi0.0: set_deviation: illegal input param
> > [   64.225298] pi433 spi0.0: set: deviation
> > [   64.225306] pi433 spi0.0: set_deviation: illegal input param
> > [   64.225314] pi433 spi0.0: set: DIO mapping
> > [   64.225347] pi433 spi0.0: read 0x0 from reg 0x25
> > [   64.225376] pi433 spi0.0: wrote 0x0 to reg 0x25
> > [   64.225392] pi433 spi0.0: set: DIO mapping
> > [   64.225427] pi433 spi0.0: read 0x0 from reg 0x25
> > [   64.225455] pi433 spi0.0: wrote 0x0 to reg 0x25
> > [   64.225473] pi433 spi0.0: set: mode
> > [   64.225509] pi433 spi0.0: read 0x4 from reg 0x1
> > [   64.225539] pi433 spi0.0: wrote 0xc to reg 0x1
> > [   64.225554] pi433 pi433: thread: wait for packet to get sent/fifo to be empty
> > [   64.225563] pi433 pi433: thread: Packet sent. Set mode to stby.
> > [   64.225571] pi433 spi0.0: set: mode
> > [   64.225603] pi433 spi0.0: read 0x8 from reg 0x1
> > [   64.225631] pi433 spi0.0: wrote 0x4 to reg 0x1
> > [   64.225644] pi433 pi433: thread: going to wait for new messages
> > [   64.225658] pi433 pi433: read 2 message byte(s) from fifo queue.
> > [   64.225674] pi433 spi0.0: set: mode
> > [   64.225708] pi433 spi0.0: read 0x4 from reg 0x1
> > [   64.225737] pi433 spi0.0: wrote 0x4 to reg 0x1
> > [   64.225748] pi433 spi0.0: set: fifo threshold
> > [   64.225781] pi433 spi0.0: read 0xf from reg 0x3c
> > [   64.225811] pi433 spi0.0: wrote 0xf to reg 0x3c
> > [   64.225836] pi433 spi0.0: 0 - 0x0
> > [   64.225847] pi433 spi0.0: set: payload length
> > [   64.225875] pi433 spi0.0: wrote 0x0 to reg 0x38
> > [   64.225884] pi433 spi0.0: set: frequency
> > [   64.225912] pi433 spi0.0: wrote 0x0 to reg 0x7
> > [   64.225939] pi433 spi0.0: wrote 0x0 to reg 0x8
> > [   64.225965] pi433 spi0.0: wrote 0x0 to reg 0x9
> > [   64.225975] pi433 spi0.0: set: bit rate
> > [   64.226002] pi433 spi0.0: wrote 0x1a to reg 0x3
> > [   64.226029] pi433 spi0.0: wrote 0x88 to reg 0x4
> > [   64.226038] pi433 spi0.0: set: modulation
> > [   64.226071] pi433 spi0.0: read 0x8 from reg 0x2
> > [   64.226097] pi433 spi0.0: wrote 0x8 to reg 0x2
> > [   64.226106] pi433 spi0.0: set: deviation
> > [   64.226116] pi433 spi0.0: set_deviation: illegal input param
> > [   64.226124] pi433 spi0.0: set: deviation
> > [   64.226132] pi433 spi0.0: set_deviation: illegal input param
> > [   64.226142] pi433 spi0.0: set: DIO mapping
> > [   64.226173] pi433 spi0.0: read 0x0 from reg 0x25
> > [   64.226202] pi433 spi0.0: wrote 0x0 to reg 0x25
> > [   64.226216] pi433 spi0.0: set: DIO mapping
> > [   64.226249] pi433 spi0.0: read 0x0 from reg 0x25
> > [   64.226279] pi433 spi0.0: wrote 0x0 to reg 0x25
> > [   64.226296] pi433 spi0.0: set: mode
> > [   64.226332] pi433 spi0.0: read 0x4 from reg 0x1
> > [   64.226359] pi433 spi0.0: wrote 0xc to reg 0x1
> > [   64.226372] pi433 pi433: thread: wait for packet to get sent/fifo to be empty
> > [   64.226383] pi433 pi433: thread: Packet sent. Set mode to stby.
> > [   64.226392] pi433 spi0.0: set: mode
> > [   64.226423] pi433 spi0.0: read 0x8 from reg 0x1
> > [   64.226451] pi433 spi0.0: wrote 0x4 to reg 0x1
> > [   64.226463] pi433 pi433: thread: going to wait for new messages
> > [   64.226475] pi433 pi433: read 2 message byte(s) from fifo queue.
> > [   64.226490] pi433 spi0.0: set: mode
> > [   64.226528] pi433 spi0.0: read 0x4 from reg 0x1
> > [   64.226557] pi433 spi0.0: wrote 0x4 to reg 0x1
> > [   64.226569] pi433 spi0.0: set: fifo threshold
> > [   64.226601] pi433 spi0.0: read 0xf from reg 0x3c
> > [   64.226630] pi433 spi0.0: wrote 0xf to reg 0x3c
> > [   64.226658] pi433 spi0.0: 0 - 0x0
> > [   64.226668] pi433 spi0.0: set: payload length
> > [   64.226696] pi433 spi0.0: wrote 0x0 to reg 0x38
> > [   64.226706] pi433 spi0.0: set: frequency
> > [   64.226732] pi433 spi0.0: wrote 0x0 to reg 0x7
> > [   64.226760] pi433 spi0.0: wrote 0x0 to reg 0x8
> > [   64.226787] pi433 spi0.0: wrote 0x0 to reg 0x9
> > [   64.226797] pi433 spi0.0: set: bit rate
> > [   64.226825] pi433 spi0.0: wrote 0x1a to reg 0x3
> > [   64.226851] pi433 spi0.0: wrote 0x88 to reg 0x4
> > [   64.226861] pi433 spi0.0: set: modulation
> > [   64.226893] pi433 spi0.0: read 0x8 from reg 0x2
> > [   64.226921] pi433 spi0.0: wrote 0x8 to reg 0x2
> > [   64.226931] pi433 spi0.0: set: deviation
> > [   64.226939] pi433 spi0.0: set_deviation: illegal input param
> > [   64.226948] pi433 spi0.0: set: deviation
> > [   64.226956] pi433 spi0.0: set_deviation: illegal input param
> > [   64.226964] pi433 spi0.0: set: DIO mapping
> > [   64.226995] pi433 spi0.0: read 0x0 from reg 0x25
> > [   64.227026] pi433 spi0.0: wrote 0x0 to reg 0x25
> > [   64.227040] pi433 spi0.0: set: DIO mapping
> > [   64.227074] pi433 spi0.0: read 0x0 from reg 0x25
> > [   64.227101] pi433 spi0.0: wrote 0x0 to reg 0x25
> > [   64.227117] pi433 spi0.0: set: mode
> > [   64.227154] pi433 spi0.0: read 0x4 from reg 0x1
> > [   64.227183] pi433 spi0.0: wrote 0xc to reg 0x1
> > [   64.227197] pi433 pi433: thread: wait for packet to get sent/fifo to be empty
> > [   64.227206] pi433 pi433: thread: Packet sent. Set mode to stby.
> > [   64.227214] pi433 spi0.0: set: mode
> > [   64.227245] pi433 spi0.0: read 0x8 from reg 0x1
> > [   64.227275] pi433 spi0.0: wrote 0x4 to reg 0x1
> > [   64.227286] pi433 pi433: thread: going to wait for new messages
> > [   64.227300] pi433 pi433: read 2 message byte(s) from fifo queue.
> > [   64.227315] pi433 spi0.0: set: mode
> > [   64.227350] pi433 spi0.0: read 0x4 from reg 0x1
> > [   64.227379] pi433 spi0.0: wrote 0x4 to reg 0x1
> > [   64.227392] pi433 spi0.0: set: fifo threshold
> > [   64.227425] pi433 spi0.0: read 0xf from reg 0x3c
> > [   64.227454] pi433 spi0.0: wrote 0xf to reg 0x3c
> > [   64.227480] pi433 spi0.0: 0 - 0x0
> > [   64.227491] pi433 spi0.0: set: payload length
> > [   64.227520] pi433 spi0.0: wrote 0x0 to reg 0x38
> > [   64.227531] pi433 spi0.0: set: frequency
> > [   64.227557] pi433 spi0.0: wrote 0x0 to reg 0x7
> > [   64.227586] pi433 spi0.0: wrote 0x0 to reg 0x8
> > [   64.227611] pi433 spi0.0: wrote 0x0 to reg 0x9
> > [   64.227621] pi433 spi0.0: set: bit rate
> > [   64.227714] pi433 spi0.0: wrote 0x1a to reg 0x3
> > [   64.227750] pi433 spi0.0: wrote 0x88 to reg 0x4
> > [   64.227761] pi433 spi0.0: set: modulation
> > [   64.227843] pi433 spi0.0: read 0x8 from reg 0x2
> > [   64.227875] pi433 spi0.0: wrote 0x8 to reg 0x2
> > [   64.227885] pi433 spi0.0: set: deviation
> > [   64.227896] pi433 spi0.0: set_deviation: illegal input param
> > [   64.227904] pi433 spi0.0: set: deviation
> > [   64.227912] pi433 spi0.0: set_deviation: illegal input param
> > [   64.227920] pi433 spi0.0: set: DIO mapping
> > [   64.227953] pi433 spi0.0: read 0x0 from reg 0x25
> > [   64.227983] pi433 spi0.0: wrote 0x0 to reg 0x25
> > [   64.227998] pi433 spi0.0: set: DIO mapping
> > [   64.228035] pi433 spi0.0: read 0x0 from reg 0x25
> > [   64.228063] pi433 spi0.0: wrote 0x0 to reg 0x25
> > [   64.228080] pi433 spi0.0: set: mode
> > [   64.228116] pi433 spi0.0: read 0x4 from reg 0x1
> > [   64.228146] pi433 spi0.0: wrote 0xc to reg 0x1
> > [   64.228161] pi433 pi433: thread: wait for packet to get sent/fifo to be empty
> > [   64.228171] pi433 pi433: thread: Packet sent. Set mode to stby.
> > [   64.228179] pi433 spi0.0: set: mode
> > [   64.228210] pi433 spi0.0: read 0x8 from reg 0x1
> > [   64.228238] pi433 spi0.0: wrote 0x4 to reg 0x1
> > [   64.228250] pi433 pi433: thread: going to wait for new messages
> > [   64.228263] pi433 pi433: read 2 message byte(s) from fifo queue.
> > [   64.228282] pi433 spi0.0: set: mode
> > [   64.228317] pi433 spi0.0: read 0x4 from reg 0x1
> > [   64.228347] pi433 spi0.0: wrote 0x4 to reg 0x1
> > [   64.228357] pi433 spi0.0: set: fifo threshold
> > [   64.228387] pi433 spi0.0: read 0xf from reg 0x3c
> > [   64.228417] pi433 spi0.0: wrote 0xf to reg 0x3c
> > [   64.228443] pi433 spi0.0: 0 - 0x0
> > [   64.228453] pi433 spi0.0: set: payload length
> > [   64.228479] pi433 spi0.0: wrote 0x0 to reg 0x38
> > [   64.228489] pi433 spi0.0: set: frequency
> > [   64.228517] pi433 spi0.0: wrote 0x0 to reg 0x7
> > [   64.228544] pi433 spi0.0: wrote 0x0 to reg 0x8
> > [   64.228571] pi433 spi0.0: wrote 0x0 to reg 0x9
> > [   64.228581] pi433 spi0.0: set: bit rate
> > [   64.228609] pi433 spi0.0: wrote 0x1a to reg 0x3
> > [   64.228636] pi433 spi0.0: wrote 0x88 to reg 0x4
> > [   64.228648] pi433 spi0.0: set: modulation
> > [   64.228682] pi433 spi0.0: read 0x8 from reg 0x2
> > [   64.228709] pi433 spi0.0: wrote 0x8 to reg 0x2
> > [   64.228720] pi433 spi0.0: set: deviation
> > [   64.228730] pi433 spi0.0: set_deviation: illegal input param
> > [   64.228738] pi433 spi0.0: set: deviation
> > [   64.228746] pi433 spi0.0: set_deviation: illegal input param
> > [   64.228754] pi433 spi0.0: set: DIO mapping
> > [   64.228787] pi433 spi0.0: read 0x0 from reg 0x25
> > [   64.228814] pi433 spi0.0: wrote 0x0 to reg 0x25
> > [   64.228829] pi433 spi0.0: set: DIO mapping
> > [   64.228863] pi433 spi0.0: read 0x0 from reg 0x25
> > [   64.228891] pi433 spi0.0: wrote 0x0 to reg 0x25
> > [   64.228908] pi433 spi0.0: set: mode
> > [   64.228943] pi433 spi0.0: read 0x4 from reg 0x1
> > [   64.228971] pi433 spi0.0: wrote 0xc to reg 0x1
> > [   64.228985] pi433 pi433: thread: wait for packet to get sent/fifo to be empty
> > [   64.228995] pi433 pi433: thread: Packet sent. Set mode to stby.
> > [   64.229003] pi433 spi0.0: set: mode
> > [   64.229036] pi433 spi0.0: read 0x8 from reg 0x1
> > [   64.229064] pi433 spi0.0: wrote 0x4 to reg 0x1
> > [   64.229075] pi433 pi433: thread: going to wait for new messages
> > [   64.229089] pi433 pi433: read 2 message byte(s) from fifo queue.
> > [   64.229106] pi433 spi0.0: set: mode
> > [   64.229141] pi433 spi0.0: read 0x4 from reg 0x1
> > [   64.229171] pi433 spi0.0: wrote 0x4 to reg 0x1
> > [   64.229182] pi433 spi0.0: set: fifo threshold
> > [   64.229214] pi433 spi0.0: read 0xf from reg 0x3c
> > [   64.229243] pi433 spi0.0: wrote 0xf to reg 0x3c
> > [   64.229271] pi433 spi0.0: 0 - 0x0
> > [   64.229281] pi433 spi0.0: set: payload length
> > [   64.229309] pi433 spi0.0: wrote 0x0 to reg 0x38
> > [   64.229319] pi433 spi0.0: set: frequency
> > [   64.229345] pi433 spi0.0: wrote 0x0 to reg 0x7
> > [   64.229374] pi433 spi0.0: wrote 0x0 to reg 0x8
> > [   64.229401] pi433 spi0.0: wrote 0x0 to reg 0x9
> > [   64.229412] pi433 spi0.0: set: bit rate
> > [   64.229440] pi433 spi0.0: wrote 0x1a to reg 0x3
> > [   64.229467] pi433 spi0.0: wrote 0x88 to reg 0x4
> > [   64.229477] pi433 spi0.0: set: modulation
> > [   64.229510] pi433 spi0.0: read 0x8 from reg 0x2
> > [   64.229539] pi433 spi0.0: wrote 0x8 to reg 0x2
> > [   64.229550] pi433 spi0.0: set: deviation
> > [   64.229558] pi433 spi0.0: set_deviation: illegal input param
> > [   64.229566] pi433 spi0.0: set: deviation
> > [   64.229574] pi433 spi0.0: set_deviation: illegal input param
> > [   64.229582] pi433 spi0.0: set: DIO mapping
> > [   64.229615] pi433 spi0.0: read 0x0 from reg 0x25
> > [   64.229645] pi433 spi0.0: wrote 0x0 to reg 0x25
> > [   64.229659] pi433 spi0.0: set: DIO mapping
> > [   64.229694] pi433 spi0.0: read 0x0 from reg 0x25
> > [   64.229721] pi433 spi0.0: wrote 0x0 to reg 0x25
> > [   64.229739] pi433 spi0.0: set: mode
> > [   64.229775] pi433 spi0.0: read 0x4 from reg 0x1
> > [   64.229805] pi433 spi0.0: wrote 0xc to reg 0x1
> > [   64.229817] pi433 pi433: thread: wait for packet to get sent/fifo to be empty
> > [   64.229828] pi433 pi433: thread: Packet sent. Set mode to stby.
> > [   64.229836] pi433 spi0.0: set: mode
> > [   64.229869] pi433 spi0.0: read 0x8 from reg 0x1
> > [   64.229897] pi433 spi0.0: wrote 0x4 to reg 0x1
> > [   64.229909] pi433 pi433: thread: going to wait for new messages
> > [   64.229922] pi433 pi433: read 2 message byte(s) from fifo queue.
> > [   64.229939] pi433 spi0.0: set: mode
> > [   64.229973] pi433 spi0.0: read 0x4 from reg 0x1
> > [   64.230002] pi433 spi0.0: wrote 0x4 to reg 0x1
> > [   64.230013] pi433 spi0.0: set: fifo threshold
> > [   64.230045] pi433 spi0.0: read 0xf from reg 0x3c
> > [   64.230074] pi433 spi0.0: wrote 0xf to reg 0x3c
> > [   64.230099] pi433 spi0.0: 0 - 0x0
> > [   64.230109] pi433 spi0.0: set: payload length
> > [   64.230137] pi433 spi0.0: wrote 0x0 to reg 0x38
> > [   64.230148] pi433 spi0.0: set: frequency
> > [   64.230175] pi433 spi0.0: wrote 0x0 to reg 0x7
> > [   64.230203] pi433 spi0.0: wrote 0x0 to reg 0x8
> > [   64.230227] pi433 spi0.0: wrote 0x0 to reg 0x9
> > [   64.230237] pi433 spi0.0: set: bit rate
> > [   64.230266] pi433 spi0.0: wrote 0x1a to reg 0x3
> > [   64.230293] pi433 spi0.0: wrote 0x88 to reg 0x4
> > [   64.230303] pi433 spi0.0: set: modulation
> > [   64.230336] pi433 spi0.0: read 0x8 from reg 0x2
> > [   64.230362] pi433 spi0.0: wrote 0x8 to reg 0x2
> > [   64.230375] pi433 spi0.0: set: deviation
> > [   64.230383] pi433 spi0.0: set_deviation: illegal input param
> > [   64.230392] pi433 spi0.0: set: deviation
> > [   64.230401] pi433 spi0.0: set_deviation: illegal input param
> > [   64.230409] pi433 spi0.0: set: DIO mapping
> > [   64.230442] pi433 spi0.0: read 0x0 from reg 0x25
> > [   64.230469] pi433 spi0.0: wrote 0x0 to reg 0x25
> > [   64.230484] pi433 spi0.0: set: DIO mapping
> > [   64.230520] pi433 spi0.0: read 0x0 from reg 0x25
> > [   64.230547] pi433 spi0.0: wrote 0x0 to reg 0x25
> > [   64.230565] pi433 spi0.0: set: mode
> > [   64.230600] pi433 spi0.0: read 0x4 from reg 0x1
> > [   64.230629] pi433 spi0.0: wrote 0xc to reg 0x1
> > [   64.230643] pi433 pi433: thread: wait for packet to get sent/fifo to be empty
> > [   64.230654] pi433 pi433: thread: Packet sent. Set mode to stby.
> > [   64.230662] pi433 spi0.0: set: mode
> > [   64.230695] pi433 spi0.0: read 0x8 from reg 0x1
> > [   64.230722] pi433 spi0.0: wrote 0x4 to reg 0x1
> > [   64.230733] pi433 pi433: thread: going to wait for new messages
> > [   64.230746] pi433 pi433: read 2 message byte(s) from fifo queue.
> > [   64.230762] pi433 spi0.0: set: mode
> > [   64.230799] pi433 spi0.0: read 0x4 from reg 0x1
> > [   64.230830] pi433 spi0.0: wrote 0x4 to reg 0x1
> > [   64.230839] pi433 spi0.0: set: fifo threshold
> > [   64.230871] pi433 spi0.0: read 0xf from reg 0x3c
> > [   64.230901] pi433 spi0.0: wrote 0xf to reg 0x3c
> > [   64.230928] pi433 spi0.0: 0 - 0x0
> > [   64.230939] pi433 spi0.0: set: payload length
> > [   64.230967] pi433 spi0.0: wrote 0x0 to reg 0x38
> > [   64.230977] pi433 spi0.0: set: frequency
> > [   64.231003] pi433 spi0.0: wrote 0x0 to reg 0x7
> > [   64.231033] pi433 spi0.0: wrote 0x0 to reg 0x8
> > [   64.231059] pi433 spi0.0: wrote 0x0 to reg 0x9
> > [   64.231070] pi433 spi0.0: set: bit rate
> > [   64.231098] pi433 spi0.0: wrote 0x1a to reg 0x3
> > [   64.231125] pi433 spi0.0: wrote 0x88 to reg 0x4
> > [   64.231136] pi433 spi0.0: set: modulation
> > [   64.231169] pi433 spi0.0: read 0x8 from reg 0x2
> > [   64.231196] pi433 spi0.0: wrote 0x8 to reg 0x2
> > [   64.231207] pi433 spi0.0: set: deviation
> > [   64.231216] pi433 spi0.0: set_deviation: illegal input param
> > [   64.231223] pi433 spi0.0: set: deviation
> > [   64.231231] pi433 spi0.0: set_deviation: illegal input param
> > [   64.231239] pi433 spi0.0: set: DIO mapping
> > [   64.231273] pi433 spi0.0: read 0x0 from reg 0x25
> > [   64.231300] pi433 spi0.0: wrote 0x0 to reg 0x25
> > [   64.231315] pi433 spi0.0: set: DIO mapping
> > [   64.231350] pi433 spi0.0: read 0x0 from reg 0x25
> > [   64.231378] pi433 spi0.0: wrote 0x0 to reg 0x25
> > [   64.231397] pi433 spi0.0: set: mode
> > [   64.231432] pi433 spi0.0: read 0x4 from reg 0x1
> > [   64.231462] pi433 spi0.0: wrote 0xc to reg 0x1
> > [   64.231475] pi433 pi433: thread: wait for packet to get sent/fifo to be empty
> > [   64.231485] pi433 pi433: thread: Packet sent. Set mode to stby.
> > [   64.231493] pi433 spi0.0: set: mode
> > [   64.231529] pi433 spi0.0: read 0x8 from reg 0x1
> > [   64.231555] pi433 spi0.0: wrote 0x4 to reg 0x1
> > [   64.231567] pi433 pi433: thread: going to wait for new messages
> > [   64.231582] pi433 pi433: read 2 message byte(s) from fifo queue.
> > [   64.231597] pi433 spi0.0: set: mode
> > [   64.231632] pi433 spi0.0: read 0x4 from reg 0x1
> > [   64.231663] pi433 spi0.0: wrote 0x4 to reg 0x1
> > [   64.231673] pi433 spi0.0: set: fifo threshold
> > [   64.231704] pi433 spi0.0: read 0xf from reg 0x3c
> > [   64.231733] pi433 spi0.0: wrote 0xf to reg 0x3c
> > [   64.231759] pi433 spi0.0: 0 - 0x0
> > [   64.231773] pi433 spi0.0: set: payload length
> > [   64.231799] pi433 spi0.0: wrote 0x0 to reg 0x38
> > [   64.231809] pi433 spi0.0: set: frequency
> > [   64.231837] pi433 spi0.0: wrote 0x0 to reg 0x7
> > [   64.231864] pi433 spi0.0: wrote 0x0 to reg 0x8
> > [   64.231890] pi433 spi0.0: wrote 0x0 to reg 0x9
> > [   64.231900] pi433 spi0.0: set: bit rate
> > [   64.231927] pi433 spi0.0: wrote 0x1a to reg 0x3
> > [   64.231954] pi433 spi0.0: wrote 0x88 to reg 0x4
> > [   64.231965] pi433 spi0.0: set: modulation
> > [   64.231995] pi433 spi0.0: read 0x8 from reg 0x2
> > [   64.232023] pi433 spi0.0: wrote 0x8 to reg 0x2
> > [   64.232035] pi433 spi0.0: set: deviation
> > [   64.232044] pi433 spi0.0: set_deviation: illegal input param
> > [   64.232051] pi433 spi0.0: set: deviation
> > [   64.232059] pi433 spi0.0: set_deviation: illegal input param
> > [   64.232068] pi433 spi0.0: set: DIO mapping
> > [   64.232101] pi433 spi0.0: read 0x0 from reg 0x25
> > [   64.232127] pi433 spi0.0: wrote 0x0 to reg 0x25
> > [   64.232143] pi433 spi0.0: set: DIO mapping
> > [   64.232178] pi433 spi0.0: read 0x0 from reg 0x25
> > [   64.232206] pi433 spi0.0: wrote 0x0 to reg 0x25
> > [   64.232224] pi433 spi0.0: set: mode
> > [   64.232258] pi433 spi0.0: read 0x4 from reg 0x1
> > [   64.232287] pi433 spi0.0: wrote 0xc to reg 0x1
> > [   64.232300] pi433 pi433: thread: wait for packet to get sent/fifo to be empty
> > [   64.232310] pi433 pi433: thread: Packet sent. Set mode to stby.
> > [   64.232318] pi433 spi0.0: set: mode
> > [   64.232351] pi433 spi0.0: read 0x8 from reg 0x1
> > [   64.232378] pi433 spi0.0: wrote 0x4 to reg 0x1
> > [   64.232390] pi433 pi433: thread: going to wait for new messages
> > [   64.232404] pi433 pi433: read 2 message byte(s) from fifo queue.
> > [   64.232421] pi433 spi0.0: set: mode
> > [   64.232456] pi433 spi0.0: read 0x4 from reg 0x1
> > [   64.232485] pi433 spi0.0: wrote 0x4 to reg 0x1
> > [   64.232495] pi433 spi0.0: set: fifo threshold
> > [   64.232528] pi433 spi0.0: read 0xf from reg 0x3c
> > [   64.232557] pi433 spi0.0: wrote 0xf to reg 0x3c
> > [   64.235171] pi433 pi433: write: generated new msg with 2 bytes.
> > 
> > Now I got again hundreds messages of kind:
> > 
> > [   64.235198] pi433 pi433: write: generated new msg with 2 bytes.
> > 
> > snip
> > 
> > [   64.250836] pi433 spi0.0: 0 - 0x0
> > [   64.250859] pi433 spi0.0: set: payload length
> > [   64.250938] pi433 spi0.0: wrote 0x0 to reg 0x38
> > [   64.250951] pi433 spi0.0: set: frequency
> > [   64.251019] pi433 spi0.0: wrote 0x0 to reg 0x7
> > [   64.251086] pi433 spi0.0: wrote 0x0 to reg 0x8
> > [   64.251153] pi433 spi0.0: wrote 0x0 to reg 0x9
> > [   64.251168] pi433 spi0.0: set: bit rate
> > [   64.251233] pi433 spi0.0: wrote 0x1a to reg 0x3
> > [   64.251299] pi433 spi0.0: wrote 0x88 to reg 0x4
> > [   64.251312] pi433 spi0.0: set: modulation
> > [   64.251383] pi433 spi0.0: read 0x8 from reg 0x2
> > [   64.251449] pi433 spi0.0: wrote 0x8 to reg 0x2
> > [   64.251461] pi433 spi0.0: set: deviation
> > [   64.251471] pi433 spi0.0: set_deviation: illegal input param
> > [   64.251479] pi433 spi0.0: set: deviation
> > [   64.251487] pi433 spi0.0: set_deviation: illegal input param
> > [   64.251497] pi433 spi0.0: set: DIO mapping
> > [   64.251567] pi433 spi0.0: read 0x0 from reg 0x25
> > [   64.251631] pi433 spi0.0: wrote 0x0 to reg 0x25
> > [   64.251709] pi433 spi0.0: set: DIO mapping
> > [   64.251836] pi433 spi0.0: read 0x0 from reg 0x25
> > [   64.251911] pi433 spi0.0: wrote 0x0 to reg 0x25
> > [   64.251936] pi433 spi0.0: set: mode
> > [   64.252008] pi433 spi0.0: read 0x4 from reg 0x1
> > 
> > Now I got again hundreds messages of kind:
> > 
> > [   64.252112] pi433 pi433: write: generated new msg with 2 bytes.
> > 
> > snip
> > 
> > [   64.255690] pi433 pi433: write to fifo failed: 0x0
> > [   64.256575] pi433 spi0.0: wrote 0xc to reg 0x1
> > [   64.256600] pi433 pi433: thread: wait for packet to get sent/fifo to be empty
> > [   64.256613] pi433 pi433: thread: Packet sent. Set mode to stby.
> > [   64.256623] pi433 spi0.0: set: mode
> > [   64.258122] pi433 spi0.0: read 0x8 from reg 0x1
> > [   64.258235] pi433 spi0.0: wrote 0x4 to reg 0x1
> > [   64.258257] pi433 pi433: thread: going to wait for new messages
> > 
> > 
> > Best regards,
> > 
> > Oliver
> > 
> 
> Hi Oliver,
> 
> thanks for testing with real hardware :-)
> 
> In my product, I use Raspbian. Therefore, I work with a kernel from 
> Raspbian. Raspbian supports device tree overlays.
> 
> So I don't use dtparam=spi=on, but dtoverlay=pi433.
> I don't modify the bcm2835-rpi-b-rev2.dts, but use the 
> pi433-overlay.dts, provided in the driver documentation.
> 
> I am not sure, whether you need to load spi_bcm2835. I never did that, 
> but maybe it is done implicitly on my system.
> 
> 
> 
> Never adressed Pi433 from command line, but always used a program to do so.
> Anyway: The way you did it, you missed to setup the tx and/or rx 
> configuration. I am not sure, whether there are useful defaults in the 
> current version of the driver, allowing you can start with tx right from 
> the start. Most probably all entries are preset with zero, that might 
> lead to an not really perfect configuration of the chip. So you need to 
> use the ioctl first, to set usefull config params.
> 
> I don't know, what generates the hundrets of "write: generated new msg 
> with 2 bytes.".
> This message is shown up, as soon as you ask the driver to send 
> something. There is an internal (SW) queue, where tx jobs get stored. 
> The message tells you, that a telegram with 2 bytes was stored in this 
> queue. I guess the two bytes are the '1' and a new line, generated by 
> the echo. The repetition of the message is quite strange.
> Maybe due to misssing configuration / bad default settings.
> As soon, as there is something in the queue, the driver should leave RX 
> mode (where he was waiting for messages in the air) and start to 
> transfer the messages from the queue with the given (or in your case 
> missing) configuration for TX. As soon as the queue is empty, the driver 
> should reconfigure for RX and restart listening on the air.
> 
Hi,

this is due to fact that pi433_write returns 0 on successful copy while
it should return 'copied' value. So it is a bug :)

'0' means nothing was copied so userpsace calls pi433_write again and
again, data is put to fifo and when it is full it goes to abort and
returns -EAGAIN and logs message write to fifo failed: 0x0

Additionally set_devaiation is also failing due to unset tx_cfg values:
[   64.231216] pi433 spi0.0: set_deviation: illegal input param

Ideally would be to have 'dafault' rx/tx config set in the driver.

Regards,
Marcin

> Unfortunally I can't find the source code from my testprogram, that is 
> compatible with the current version of the driver. Hope I didn't format 
> the wrong SD-card.
> Just found sources for the "old" version of the driver, that was 
> intended to support more then just Pi433...
> 
> Will provide the source as soon as I find it.
> At the moment, I just can provide a binary, if it helps...
> 
> Hope this helps understanding,
> regards,
> 
> Marcus


More information about the devel mailing list