Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x

Raspberry Pi

133

Solutions

241

Contributors

The Raspberry Pi Foundation works to put the power of digital making into the hands of people all over the world, so they are capable of understanding and shaping our increasingly digital world, able to solve the problems that matter to them, and equipped for the jobs of the future.

We provide low-cost, high-performance computers that people use to learn, solve problems and have fun. We provide outreach and education to help more people access computing and digital making. We develop free resources to help people learn about computing and how to make things with computers, and train educators who can guide other people to learn.

Share tech news, updates, or what's on your mind.

Sign up to Post

USB GPS Detection on Raspberry PI

I have some python code that scans WIFI packets and in my receiver code I have an instance of a GPSPoller class.

The issue I am having is that withing the gps library gpscommon.read() blocks when there is no GPS dongle connected to the Pi.

I couldn't seem to find an elegant way to check to see if gpds has any devices added to its device pool so I could skip my code that starts polling gpsd for position data.

I don't want to write code to check for /dev/ttyUSB0 as that does not seem like a very elegant solution.

Can anyone provide advice?
0
 

Author Comment

by:spencerturbine
lsusb would list my device but then I would have to write software that looks for the specific device. If I swapped out the receiver for a different kind I would have to change the code to take that into account.

I hope there is a better way to do it that lsusb.
0
 

Expert Comment

by:Mark Wieder
Yeah, if you want the code to be more generic (how often do you intend to swap out a different gps dongle?) then lsusb probably won't help here. You might try setting up a socket connection to port 2947 and trap the error, but you'll have to do this before instantiating the gps class because the class initializer does that as well.
0
https://www.pine64.org/?page_id=3707

Have you worked with a Pinbook for surfing or other?
2
 
LVL 9

Expert Comment

by:Brandon Lyon
I thought about getting one back when they announced it. I decided to wait for reviews mainly because I was unsure how good (or bad) the screen and keyboard might be. That and other options are getting ridiculously cheap.
0
 
LVL 48

Expert Comment

by:Jackie Man
According to its spec, PINEBOOK is similar to a Raspberry Pi 3 and it may be the reason why it can be made so cheaply.
0
4
 

Expert Comment

by:Daniella Barion
Outstanding how people can be creative especially when they bring past memories.
1
 
LVL 7

Author Comment

by:Brian Matis
"Everything old is new again!" ;-)
1
3D Printing Technology + Raspberry Pie + Arduino + Garden + San Luis Obispo = Farmbot.io

https://farmbot.io/
6
 
LVL 2

Expert Comment

by:Juana Villa
@JamesBilous I understand your point. However, I don't find very reliable FarmBot's information about sustainability because they state "we will never truly know". Anyway, I believe they should do a study where they compare the CO2 produced for production, transportation, and use of FarmBot vs a traditional household farming.
0
 
LVL 2

Expert Comment

by:Juana Villa
@ScottFell, EarhBox looks interesting. I am thinking about having my own garden and I was looking into vertical garden. I will definitely take a look at EarthBox, it might a good option for me.
0
I just found out that Raspberry Pi foundation puts out a magazine. You can subscribe to paper copies, subscribe via app, or download issues for free from the website.

If you subscribe to the paper version for a year then you get a free Pi Zero W, but that's expensive for customers outside of the UK.
7
 
LVL 7

Expert Comment

by:Brian Matis
Nice! Looks like one of the cool things there is the various project ideas. Like this one: Fallout 4 Terminal. You should totally make that one! ;-)
2
 
LVL 9

Expert Comment

by:James Bilous
@Brian "Step 1: 3d print a fallout 4 terminal"

damn.
0
5
 
LVL 18

Expert Comment

by:Lucas Bishop
This is odd, I don't recall putting my link at the beginning of my comment...
0
 
LVL 7

Administrative Comment

by:Brian Matis
@Lucas - Thanks for mentioning that! We've definitely got a display bug there... When you look at your comment on the post's standalone page, it should be correct, but the feed view is currently displaying it in the wrong spot. We'll get a fix out in the near future for that.
0

Raspberry Pi

133

Solutions

241

Contributors

The Raspberry Pi Foundation works to put the power of digital making into the hands of people all over the world, so they are capable of understanding and shaping our increasingly digital world, able to solve the problems that matter to them, and equipped for the jobs of the future.

We provide low-cost, high-performance computers that people use to learn, solve problems and have fun. We provide outreach and education to help more people access computing and digital making. We develop free resources to help people learn about computing and how to make things with computers, and train educators who can guide other people to learn.