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

Unable To Find Compatible WiringPi Pinouts With This Library #54

Open
bonedaddy opened this issue Jan 25, 2020 · 4 comments
Open

Unable To Find Compatible WiringPi Pinouts With This Library #54

bonedaddy opened this issue Jan 25, 2020 · 4 comments

Comments

@bonedaddy
Copy link

bonedaddy commented Jan 25, 2020

I'm currently trying to write a golang equivalent of this Raspberry Pi LoRa hot module, which uses wiringPi pniouts.

I've tried the wiringPi pin out numbers in this golang library using go-rpio and I'm unable to get it to work properly, and it fails with a unrecognized traceiver error.

It should be noted that running the provided dragino examples works, so it can definitely work from this library, it's just a matter of figuring out the pin differences

System Info

Model: Raspberry Pi 3B+

No LSB modules are available.
Distributor ID:	Raspbian
Description:	Raspbian GNU/Linux 9.11 (stretch)
Release:	9.11
Codename:	stretch
Linux rpi3 4.19.66-v7+ #1253 SMP Thu Aug 15 11:49:46 BST 2019 armv7l GNU/Linux
@bonedaddy
Copy link
Author

Small update that I forgot to post yesterday, the manufacturer of the board I'm using (dragino LoRa/GPS HAT), has this diagram http://wiki.dragino.com/images/9/9b/RPi_GPIO.jpg.

So based off the pinouts that the C code is using, the translation to BCM numbers should be:

int ssPin = 25;
int dio0  = 4;
int RST   = 17;

But unfortunately go-rpio still didn't work

@drahoslove
Copy link
Collaborator

You are right, you have to use the BCM pin numbering. If it does not work, the issue is probably somewhere else.

I am sorry I think I am not able to help you.

@drahoslove
Copy link
Collaborator

drahoslove commented Feb 14, 2020

I noticed some differences between the main.c and your lora.go:
https://github.com/RTradeLtd/rpi-lora-tranceiver/blob/master/src/lora.go#L46 . - you are using RST here instead of ssPin

https://github.com/RTradeLtd/rpi-lora-tranceiver/blob/master/src/lora.go#L65 - this should be input

https://github.com/RTradeLtd/rpi-lora-tranceiver/blob/master/src/lora.go#L22 - this should be 17 not 7

Some ideas:

  • try to change SpiChipSelectPolarity and/or SpiMode
  • try to add some sleep after SpiExchange
  • you have to run the program as rood for spi functions to work

@bonedaddy
Copy link
Author

Hello, thanks for taking the time to look at the code in detail like that.

I will try your suggestions and hopefully they work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants