Go to advanced search

by bensimmo
Tue Aug 21, 2018 8:51 pm
Forum: Automation, sensing and robotics
Topic: Calculate distance traveled with a variable time and speed (Odometer)
Replies: 19
Views: 327

Re: Calculate distance traveled with a variable time and speed

If you are sampling at that rate, I think the fastest mine can go with multiple sat systems it 10Hz and I normally jsut use at 1Hz default, the Pi should still be able to do the on the fly maths You would need to buffer the readings (in case the Pi kicks off doing anything else). But if you are samp...
by bensimmo
Tue Aug 21, 2018 5:57 pm
Forum: Automation, sensing and robotics
Topic: Calculate distance traveled with a variable time and speed (Odometer)
Replies: 19
Views: 327

Re: Calculate distance traveled with a variable time and speed

What language are we in and so you have the full code?

Also it would be useful if you log each GPS update to file.
That way you can loop through it to see if there are any errors.
Plot it on a map
Re-run though it with new algorithms without having to go for a drive.
by bensimmo
Tue Aug 21, 2018 8:14 am
Forum: Python
Topic: Multiple DS18B20 Sensors on 20x4 LCD
Replies: 73
Views: 693

Re: Multiple DS18B20 Sensors on 20x4 LCD

Same here with the old Python, started with my first Pi (slowly) A+ and 2B some years back. Still learning and that's why you'll find me helping out. It helps me learn as well. It's quite different coming from a general Visual Basic, VBA and BBC Basic. BUT the logic doesn't really change, just the w...
by bensimmo
Tue Aug 21, 2018 7:51 am
Forum: Raspbian
Topic: switch raspberry pi 3 between access point and none access point
Replies: 4
Views: 90

Re: switch raspberry pi 3 between access point and none access point

monapi wrote:
Tue Aug 21, 2018 6:26 am
thanks for your help.
to use the new tutorial how should i cancel the last one. should i delete the OS and install anew one?
Up to you,
either see which bits are different and modify yours.
Reverse what you did.
Or send a few minutes rewriting the sdcard.
by bensimmo
Mon Aug 20, 2018 6:27 pm
Forum: Raspbian
Topic: switch raspberry pi 3 between access point and none access point
Replies: 4
Views: 90

Re: switch raspberry pi 3 between access point and none access point

Try here
http://www.raspberryconnect.com/network ... pcd-method
In the first paragraphs they have various links to various setup, pick one that fits what you want.
by bensimmo
Mon Aug 20, 2018 6:19 pm
Forum: Python
Topic: Multiple DS18B20 Sensors on 20x4 LCD
Replies: 73
Views: 693

Re: Multiple DS18B20 Sensors on 20x4 LCD

It does support i2c (I have the PCF board on mine)
https://github.com/dbrgn/RPLCD/blob/master/README.rst
Supported I²C Port Expanders
PCF8574 (used by a lot of I²C LCD adapters on Ali Express)
MCP23008 (used in Adafruit I²C LCD backpack)
MCP23017
by bensimmo
Mon Aug 20, 2018 4:57 pm
Forum: Add-ons
Topic: PoE HAT - Usage scenarios
Replies: 11
Views: 251

Re: PoE HAT - Usage scenarios

Thanks for the rear view picture link.
by bensimmo
Mon Aug 20, 2018 4:48 pm
Forum: Python
Topic: Multiple DS18B20 Sensors on 20x4 LCD
Replies: 73
Views: 693

Re: Multiple DS18B20 Sensors on 20x4 LCD

I've not used 433 transmitters, as I have nothing that uses them, but when looking for my garage some time back (it 8xxHz something) but left it as it looked complicated at the time. I came across this, may help https://github.com/milaq/rpi-rf Also I used the i2c display as well, it just looked a lo...
by bensimmo
Mon Aug 20, 2018 4:29 pm
Forum: Python
Topic: Multiple DS18B20 Sensors on 20x4 LCD
Replies: 73
Views: 693

Re: Multiple DS18B20 Sensors on 20x4 LCD

For the info, the reason it takes a while to display (I assume you are meaning form line to line). A DS18B20 sensor, at default, take ~750ms to get a result from when you ask it. The check for a valid result are negligible compared to that. So, because of the way the code is written You ask sensor o...
by bensimmo
Mon Aug 20, 2018 4:14 pm
Forum: Python
Topic: Multiple DS18B20 Sensors on 20x4 LCD
Replies: 73
Views: 693

Re: Multiple DS18B20 Sensors on 20x4 LCD

T-EGWZ34, time to test it is not a problem, it was just your the only one than can test it :-) and we, like most on the forum, do have a habbit of keeping on chatting :-) I have a feeling I used an apostrophe for a degree symbol to, when I did this way back when (sometime earlier this year but with ...
by bensimmo
Mon Aug 20, 2018 9:58 am
Forum: Python
Topic: Multiple DS18B20 Sensors on 20x4 LCD
Replies: 73
Views: 693

Re: Multiple DS18B20 Sensors on 20x4 LCD

Not a problem at all, I have sun glare on a phone and kids nagging all the time :-) Though if T-EGWZ34 would like to try and comment, that would be ace. all part of learning and all just trying to help, I know how annoying it can be just to get that bit of code working and you get in a muddle. I'm n...
by bensimmo
Mon Aug 20, 2018 9:09 am
Forum: Python
Topic: Multiple DS18B20 Sensors on 20x4 LCD
Replies: 73
Views: 693

Re: Multiple DS18B20 Sensors on 20x4 LCD

Ok I see the confusion, he didn't have the Temp sensors in in the first place. Please format this correctly as I cannot easily and it from Def main() so all shifted out. but its to show what might need doing. def get_temp(ds_id): #code to get temp using ds_id, personnaly I use https://github.com/tim...
by bensimmo
Mon Aug 20, 2018 8:42 am
Forum: Python
Topic: Multiple DS18B20 Sensors on 20x4 LCD
Replies: 73
Views: 693

Re: Multiple DS18B20 Sensors on 20x4 LCD

I was just hoping he would have a go at putting it in. Not you :-) As I did realise you are working blind (like me as I'm miles away from a Pi and my LCD screen (i2c)). And I was specifically directing it at you (more whoever is reading and the OP, but using your post as well that last code used :-)...
by bensimmo
Sun Aug 19, 2018 7:36 pm
Forum: Python
Topic: Multiple DS18B20 Sensors on 20x4 LCD
Replies: 73
Views: 693

Re: Multiple DS18B20 Sensors on 20x4 LCD

Pass it in Change def read_temp_raw() def read_temp() To def read_temp_raw(device_file): def read_temp(device_file): Change temperature = read_temp(device_file) And the calls to read_temp_raw in read_temp to read_temp_raw(device_file) That way you can keep track of where that variable is going. I as...
by bensimmo
Sun Aug 19, 2018 6:56 pm
Forum: Python
Topic: Multiple DS18B20 Sensors on 20x4 LCD
Replies: 73
Views: 693

Re: Multiple DS18B20 Sensors on 20x4 LCD

It doesn't look to be setup in a function, but on its own between some function. Just define it in the loop, it looks to be there to clear it at the start. Do as you are doing, but just combine the output into a string to send as is there already. Replace four lines of Prints for the For lines ofLcd...
by bensimmo
Sun Aug 19, 2018 6:16 pm
Forum: Python
Topic: Multiple DS18B20 Sensors on 20x4 LCD
Replies: 73
Views: 693

Re: Multiple DS18B20 Sensors on 20x4 LCD

It all looks a bit messy, but i'm on mobile and code is hard to read through in a tiny box. So You get you temperate values in a loop. If the text isn't going to change then just Print ( "text for line1, srt(temp[0]), "text" ) Print ( "... line2", str(temp[1]), "text") etc Assuming you have stored a...
by bensimmo
Sun Aug 19, 2018 5:11 pm
Forum: Add-ons
Topic: PoE HAT - Usage scenarios
Replies: 11
Views: 251

Re: PoE HAT - Usage scenarios

What is a shame is they didn't use a sensing fan so the speed (and in fact see if it is actually spinning) could be checked. The ability to check may well have been a bonus to PoE users as they probably cannot see or hear the fan. There is a reason pretty much every PC/laptop uses sensing fans (and ...
by bensimmo
Sun Aug 19, 2018 11:05 am
Forum: Add-ons
Topic: PoE HAT - Usage scenarios
Replies: 11
Views: 251

Re: PoE HAT - Usage scenarios

Is it possible to connect the official PoE HAT to a Pi 3B+ and power the Pi through the micro-USB rather than Power over Ethernet, to allow the PoE HAT to be used purely as a Pi-powered software controlled fan controller ? £18 for a fan? I think this is more a clarification post. Somebody may want ...
by bensimmo
Sun Aug 19, 2018 6:27 am
Forum: Beginners
Topic: program for pi A+
Replies: 7
Views: 247

Re: program for pi A+

Since I have them. Yes, it will more than likely work. There are a few things that may need tweaking. So if you get any errors, post them up. Depending on how long ago it was, some things may have changed. The major one being UART serial. In the program, if it errors, then change anything saying /de...
by bensimmo
Sat Aug 18, 2018 9:02 pm
Forum: Beginners
Topic: Serial logging project
Replies: 5
Views: 116

Re: Serial logging project

You have Mathematica to do all your data analysis with, comes free with Raspbian.

If the Arduino part is working, just hook that up to the Pi and send the data from it to the Pi. It'll be better at realtime data collection.
by bensimmo
Sat Aug 18, 2018 1:32 pm
Forum: Automation, sensing and robotics
Topic: Calculate distance traveled with a variable time and speed (Odometer)
Replies: 19
Views: 327

Re: Calculate distance traveled with a variable time and speed

Oh, you want to do this in "real time" as you drive the car? Then just do the maths as the data comes in. By default a GPS is usually 1 per second, plenty of time for a bit of maths. --- Start, distance = 0 (on pi you could have a reset button) Loop _GPS new (record long/Lat/altitude) _Distance = di...
by bensimmo
Sat Aug 18, 2018 1:27 pm
Forum: Automation, sensing and robotics
Topic: Calculate distance traveled with a variable time and speed (Odometer)
Replies: 19
Views: 327

Re: Calculate distance traveled with a variable time and speed

If for some odd reason you must stay with velocity and timen then you need to do similar but iterate through all you data point calculating the approx distance. ( Velocity End + Velocity Start ) X ( Time End - Time Start ) X 0.5 It will be an approximation. As with the Long/Lat/Altitude coords, the ...
by bensimmo
Sat Aug 18, 2018 12:53 pm
Forum: Automation, sensing and robotics
Topic: Calculate distance traveled with a variable time and speed (Odometer)
Replies: 19
Views: 327

Re: Calculate distance traveled with a variable time and speed

Ignore velocity.

Measure the length of the line, you have all the data points in that track.
Just add them all together.

Simplified, just use the coordinates at each point.
More accurate, include altitude.


Edit a quick search says use/look at the geopy module.
by bensimmo
Sat Aug 18, 2018 11:28 am
Forum: Scratch
Topic: Scratch 3
Replies: 10
Views: 2156

Re: Scratch 3

Quick go on a Pi3B+ (with a small sink on it) Well it takes a while to load beta.scratch.mi.edu The Pi warms nicely to just over 60C, hit throttling at this point I assume. Small program, repeat forever sprint move 50, tube 90. Graphics cannot keep up. Run Pi gets a bit warmer See what this turbmode...

Go to advanced search