first try to send data with pi433 on Raspberry Pi

Oliver Graute oliver.graute at gmail.com
Tue Dec 12 17:18:36 UTC 2017


On 11/12/17, 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
> >[   64.258257] pi433 pi433: thread: going to wait for new messages
> >
> 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.

I used a buildroot system for this very first test. 

> 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.

ok so I need to configure tx and rx before somehow. I'll look into it.
If you could provide some example howto address /dev/pi433 from
userspace and example settings would be nice.
 
> 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.

yes its strange, I also assume thats related to missing configuration.

> 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.
> 
> 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.

that would be great


Best regards,

Oliver


More information about the devel mailing list