Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Dragino Lora/GPS Raspberry Pi HAT #31

Closed
Romeo-Golf opened this issue Dec 23, 2016 · 15 comments
Closed

Support for Dragino Lora/GPS Raspberry Pi HAT #31

Romeo-Golf opened this issue Dec 23, 2016 · 15 comments

Comments

@Romeo-Golf
Copy link

@Romeo-Golf Romeo-Golf commented Dec 23, 2016

While it looks like there may be some wiring challenges, it would be useful to confirm if the Dragino Lora/GPS Hat will work out of the box with this project?

http://wiki.dragino.com/index.php?title=Lora/GPS_HAT

@Romeo-Golf

This comment has been minimized.

Copy link
Author

@Romeo-Golf Romeo-Golf commented Dec 23, 2016

And if it doesn't work out of the box it would be useful to document what additional wiring is required based on the current v1.3 board:

https://github.com/dragino/Lora/tree/master/Lora_GPS%20HAT/v1.3

And with any luck it might be possible to have these added to a future revision to take advantage of the convenience offered by having both GPS and Lots radios on a single HAT :)

@daveake

This comment has been minimized.

Copy link
Contributor

@daveake daveake commented Dec 23, 2016

@Romeo-Golf

This comment has been minimized.

Copy link
Author

@Romeo-Golf Romeo-Golf commented Dec 24, 2016

Dave,

Thanks KS for confirming, I did suspect that based on the GPS chip's PPS pin not being wires to any gpio pins the wiring of this hat hadn't been well thought out...

But as I needed a GPS hat and these GPS+LoRa boards were equivalent cost to GPS only I ordered one anyway :)

So looks like I will be using the Black Hat Hack3r board to test wiring the GPS PPS pin into the Pi GPIO, typically on GPIO 17:

https://shop.pimoroni.com/products/black-hat-hacker

Can you advise on the LoRa chip to gpio pin mapping this code is expecting?

Thanks

@daveake

This comment has been minimized.

Copy link
Contributor

@daveake daveake commented Dec 24, 2016

@Romeo-Golf

This comment has been minimized.

Copy link
Author

@Romeo-Golf Romeo-Golf commented Dec 29, 2016

Ok so the DIO pins can be specified in the config, is it possible to do the same for the NSS pin to say use GPIO pin 6 / physical pin 22 rather than pins 24 and 26 listed in the Readme?

Thanks

@daveake

This comment has been minimized.

Copy link
Contributor

@daveake daveake commented Dec 29, 2016

@Romeo-Golf

This comment has been minimized.

Copy link
Author

@Romeo-Golf Romeo-Golf commented Dec 30, 2016

Its a shame that the manufactures of this board didnt follow the 'standard', although to be fair there doesnt seem to be an abundance of documentation beyond this:

https://www.raspberrypi.org/documentation/hardware/raspberrypi/spi/

I will try physically re-mapping the pins with the hack3r board and if successful then perhaps they would consider more sensible pin mapping in the next revision.

Out of interest is ther DIO pin mapping also based on a standard or reference source?

@PiInTheSky

This comment has been minimized.

Copy link
Owner

@PiInTheSky PiInTheSky commented Dec 31, 2016

DIOs can connected to any free I/O pin, unlike SPI pins which are fixed.

@pelwell

This comment has been minimized.

Copy link

@pelwell pelwell commented Jan 16, 2017

@daveake FYI, with a suitable Device Tree overlay you can ask the SPI driver to use any random GPIOs as chip selects.

@daveake

This comment has been minimized.

Copy link
Contributor

@daveake daveake commented Jan 16, 2017

@pelwell

This comment has been minimized.

Copy link

@pelwell pelwell commented Jan 16, 2017

OK - I'd better write a suitable overlay then. I'll post it here first with instructions, then get it built into standard images.

@pelwell

This comment has been minimized.

Copy link

@pelwell pelwell commented Jan 16, 2017

The new overlay is called spi0-cs:

/dts-v1/;
/plugin/;


/ {
	compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";

	fragment@0 {
		target = <&spi0_cs_pins>;
		frag0: __overlay__ {
			brcm,pins = <8 7>;
		};
	};

	fragment@1 {
		target = <&spi0>;
		frag1: __overlay__ {
			cs-gpios = <&gpio 8 1>, <&gpio 7 1>;
			status = "okay";
		};
	};

	__overrides__ {
		cs0_pin  = <&frag0>,"brcm,pins:0",
			   <&frag1>,"cs-gpios:4";
		cs1_pin  = <&frag0>,"brcm,pins:4",
			   <&frag1>,"cs-gpios:16";
	};
};

Save the above to spi0-cs-overlay.dts, and compile it using:

sudo dtc -@ -I dts -O dtb -o /boot/spi0-cs.dtbo spi0-cs-overlay.dts

Then add the following to config.txt (you can change the 12 and 13 or omit either cs?_pin):

dtoverlay=spi0-cs,cs0_pin=12,cs1_pin=13

The overlay is now in the kernel source tree, and will be included in future builds.

@jorgerance

This comment has been minimized.

Copy link

@jorgerance jorgerance commented Oct 11, 2017

Is this already supported? Just got one of those Dragino boards and I was willing to play with some "Pi in the sky" nodes, but I can't get the tracker to work and the following message appears on screen:

Channel 0 power set to FFh
Setting SF=8
Setting Error Coding=5

gateway.txt content:

frequency_0=868.100
mode_0=0
AFC_0=Y
bandwidth_0=125K
implicit_0=0
coding_0=5
sf_0=8
lowopt_0=0
power_0=255
DIO0_0=13
DIO5_0=12
UplinkTime_0=2
UplinkCycle_0=60

config.txt:

pi@raspberrypi:/boot $ tail -1 config.txt
dtoverlay=spi0-cs,cs0_pin=12,cs1_pin=13
pi@raspberrypi:/boot $

Can anyone please advise? Is it possible to use these Dragino boards as tracking stations?

@daveake

This comment has been minimized.

Copy link
Contributor

@daveake daveake commented Oct 11, 2017

@2020rberry

This comment has been minimized.

Copy link

@2020rberry 2020rberry commented Jan 17, 2018

Two questions. One, would this board work with it? And two, if yes, my board says I'm using the 915MHz range, but when I put that in as the channel it doesn't work. Any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.