Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Fuzz1111
Mar 17, 2001

Sorry. I couldn't find anyone to make you a cool cipher-themed avatar, and the look on this guy's face cracks me the fuck up.

Amethyst posted:

Is the pi 3b+ enough to make a little wifi router? Do I need any extra hardware?
If you aren't fussed about having a nice interface and know your way around iptables it is quite capable of maxing out the 100mbps limit of the Ethernet adapter (as long the usb Ethernet adapter you use for your second interface can do it too).

I recently set up a pi3b as a router of sorts - quite a bit more demanding though: it would redirect all internet-bound outgoing traffic through an SSH tunnel going through an http proxy, and to do this involved a combination of cntlm, desproxy, ssh, redsocks and a shitload of iptables rules.

Despite the complexity I noticed that I could hit 100mbps in both directions and ping times through it were single digit too.

Adbot
ADBOT LOVES YOU

evil_bunnY
Apr 2, 2003

xzzy posted:

There are things the pi is extremely good for where the "should I?" answer is yes.

You just have to manage expectations and get a feel for what the pi is good at.

(those GPIO pins are amazing)
This is the right view IMO. Low throughput, medium compute needs but with a use case that requires whatever ports the RPi give you.

Schadenboner
Aug 15, 2011

by Shine
So the last update on the OP is like 7 years old at this point and still has the A as the top of the line, in betting that’s no longer an operative statement? I’m just starting to plan building a couple of PiHoles for DNS servers at home and I have a couple of questions:

1. The B+ is the current big swinging dick in the Raspberry Pi stable right? And indications of a new one anytime soon?
2. Assuming 1 (above), what should an literal babby’s first RPi kit cost? Amazon shows a board-and-heat sink-and-power-and-thermal goop for like 50 bucks?

:tipshat:

E: no case or card in that kit though.

Schadenboner fucked around with this message at 01:50 on May 5, 2019

astral
Apr 26, 2004

Schadenboner posted:

So the last update on the OP is like 7 years old at this point and still has the A as the top of the line, in betting that’s no longer an operative statement? I’m just starting to plan building a couple of PiHoles for DNS servers at home and I have a couple of questions:

1. The B+ is the current big swinging dick in the Raspberry Pi stable right? And indications of a new one anytime soon?
2. Assuming 1 (above), what should an literal babby’s first RPi kit cost? Amazon shows a board-and-heat sink-and-power-and-thermal goop for like 50 bucks?

:tipshat:

E: no case or card in that kit though.

If it hasn't changed since I bought a Pi 3, you can find kits for around $60 that include RPi, a power supply, sd card, and a case.

Klyith
Aug 3, 2007

GBS Pledge Week
For a PiHole you could use any Pi that works with your network, including a Zero W if wifi is ok. DNS responses are not difficult.

Wibla
Feb 16, 2011

Klyith posted:

DNS responses are not difficult.

You would be surprised.

Also hi! :sun:

General_Failure
Apr 17, 2005

MrPablo posted:

If you look at my previous response to you earlier in this thread there are instructions for installing TensorFlow on a Raspberry Pi Zero.


Trying again. It fell over with an incorrect hash for TensorFlow. I don't know why, but I hope the pip package wasn't tampered with.

Just for fun, the Pi Zero W that I'm trying it with is in a zip loc bag in the back yard connected to an old deep cycle battery and a 10W solar panel via a car usb charger. Because why not.

MrPablo
Mar 21, 2003

General_Failure posted:

Trying again. It fell over with an incorrect hash for TensorFlow. I don't know why, but I hope the pip package wasn't tampered with.

Just for fun, the Pi Zero W that I'm trying it with is in a zip loc bag in the back yard connected to an old deep cycle battery and a 10W solar panel via a car usb charger. Because why not.

I can't tell if this is a joke or not?

If it's not a joke: Typically when you are trying to isolate a problem you want to remove sources of uncertainty, which would mean doing this sort of thing on Pi Zero W in a dry area with a consistent temperature and a reliable source of power.

If I had to guess about the hash mismatch, I would guess either filesystem corruption or a power issue. I doubt someone is tampering with the pip package.

susan b buffering
Nov 14, 2016

PyPy packages can’t be changed once they are uploaded, so unless PyPy itself has been breached it’s not gonna be someone tampering with it.

General_Failure
Apr 17, 2005

MrPablo posted:

I can't tell if this is a joke or not?

If it's not a joke: Typically when you are trying to isolate a problem you want to remove sources of uncertainty, which would mean doing this sort of thing on Pi Zero W in a dry area with a consistent temperature and a reliable source of power.

If I had to guess about the hash mismatch, I would guess either filesystem corruption or a power issue. I doubt someone is tampering with the pip package.

Nah. When all the issues started it was on a known good power supply in the loungeroom. When I shifted it out, it was more of a "gently caress it" thing. IIRC I tried some other pip packages too. Scipy also had a mismatched hash reported.

I just checked in on the Pi btw. A bit before sunrise and it's still running. Neat!

I forgot to ask. Did you update the kernel or leave it as-is? This time round I left it alone. I doubt it's the issue, but I'm trying to find any potential variables before I reflash and try again.

MrPablo
Mar 21, 2003

General_Failure posted:

Nah. When all the issues started it was on a known good power supply in the loungeroom. When I shifted it out, it was more of a "gently caress it" thing. IIRC I tried some other pip packages too. Scipy also had a mismatched hash reported.

I just checked in on the Pi btw. A bit before sunrise and it's still running. Neat!

I forgot to ask. Did you update the kernel or leave it as-is? This time round I left it alone. I doubt it's the issue, but I'm trying to find any potential variables before I reflash and try again.

They're both either the latest kernel in stretch or almost the latest; I do a weeklyish "apt-get update && apt-get upgrade && apt-get dist-upgrade" across all my systems, including the Raspberry Pi Zero W and the Raspberry Pi 3 Model B+ that I installed and ran TensorFlow on.

code:
> for i in peach zero; do echo $i: $(ssh $i uname -r); done
peach: 4.14.79-v7+
zero: 4.14.71+

bolind
Jun 19, 2005



Pillbug
Recommend me a temperature sensor for the pi. Simple as possible, preferably no soldering, a meter of more of cable, cost not really a concern as it’s Other Peoples’ Money. USB would be nice.

Edit: range is not too crazy, 15-80°C is fine.

BONESAWWWWWW
Dec 23, 2009


Like a temperature probe? Or for air temperature?

bolind
Jun 19, 2005



Pillbug
Air temperature.

MrPablo
Mar 21, 2003

bolind posted:

Recommend me a temperature sensor for the pi. Simple as possible, preferably no soldering, a meter of more of cable, cost not really a concern as it’s Other Peoples’ Money. USB would be nice.

Edit: range is not too crazy, 15-80°C is fine.

I can't comment on USB temperature sensors, so this isn't exactly what you're looking for. That said, last year I used a DS18B20 and a BME280 with a Raspberry Pi.

DS18B20: Pros:
  • Waterproof
  • Comes with a 2 meter cable
  • Uses 1-wire protocol (modprobe w1-{gpio,therm}, read from /sys/bus/w1/devices/28-041700525fff/w1_slave)
  • Cheap!
DS18B20 Cons:
  • Temperature measurement takes a long time to stabilize (~30 seconds)
  • Slow to read
  • Finicky

BME280 Pros:
  • Measures temperature, barometric pressure, and humidity
  • Has a kernel module (modprobe bmp280_i2c, read values from /sys/bus/iio/devices/iio\:device0/in_*_input)
  • Converges on temperature quickly
  • I2C or SPI
BME280 Cons:
  • Requires soldering
  • Slightly more expensive

The BME280 ended up being a better fit for me. I used them with the existing HTPCs to track the temperature around the house:



I put together a lovely web interface that shows the current readings, and lets people download a CSV history at 15 minute intervals:



Links to the sensors I bought on Amazon:

Edit: A friend of mine has experience with USB temperature sensors. I will check with him and get back to you.
Edit 2: He posted below (as OcKhan) rather than let me mangle his recommendations.

MrPablo fucked around with this message at 18:13 on May 7, 2019

Schadenboner
Aug 15, 2011

by Shine

MrPablo posted:

I can't comment on USB temperature sensors, so this isn't exactly what you're looking for. That said, last year I used a DS18B20 and a BME280 with a Raspberry Pi.

DS18B20: Pros:
  • Waterproof
  • Comes with a 2 meter cable
  • Uses 1-wire protocol (modprobe w1-{gpio,therm}, read from /sys/bus/w1/devices/28-041700525fff/w1_slave)
  • Cheap!
DS18B20 Cons:
  • Temperature measurement takes a long time to stabilize (~30 seconds)
  • Slow to read
  • Finicky

BME280 Pros:
  • Measures temperature, barometric pressure, and humidity
  • Has a kernel module (modprobe bmp280_i2c, read values from /sys/bus/iio/devices/iio\:device0/in_*_input)
  • Converges on temperature quickly
  • I2C or SPI
BME280 Cons:
  • Requires soldering
  • Slightly more expensive

The BME280 ended up being a better fit for me. I used them with the existing HTPCs to track the temperature around the house:



I put together a lovely web interface that shows the current readings, and lets people download a CSV history at 15 minute intervals:



Links to the sensors I bought on Amazon:

Edit: A friend of mine has experience with USB temperature sensors. I will check with him and get back to you.

Im teh two decimal place precision.

E: wait, can I be the 52000% humidity instead?

Schadenboner fucked around with this message at 18:10 on May 7, 2019

OcKhan
May 7, 2019

I'd suggest looking into https://github.com/padelt/temper-python. The kicker is to find a usb device with an ID of 0c45:7401.

One example is this model from amazon: https://www.amazon.com/TEMPer-Accurate-Thermometer-Temperature-Sensor/dp/B009YRP906/

It's pretty cheap and works out of the box. I've played around with about 6-7 of them and my biggest issue was getting devices with the right ID to work with that python project because some of them had different device IDs.

If you end up with a device that has an ID of 413d:2107, use this instead https://github.com/urwen/temper.

I can report that they both work like a charm with pi zero Ws and Pi 3s. One suggestion is to consider using a short usb extension cable to get a better reading depending on where you place your PI.

There's also a munin plugin for it if you want to chart it out over time.

Additionally, I have each unit tweeting at specified intervals just because I thought it would be a somewhat useful (and dorky) way to remotely glance at temps around the house just using twitter.

Good luck

MrPablo
Mar 21, 2003

Schadenboner posted:

Im teh two decimal place precision.

E: wait, can I be the 52000% humidity instead?

It's just really, really humid here!

Seriously though, I think they must have multiplied the humidity precision in the kernel driver by 1000.

Fake Edit: Yup.

Schadenboner
Aug 15, 2011

by Shine

MrPablo posted:

It's just really, really humid here!

Seriously though, I think they must have multiplied the humidity precision in the kernel driver by 1000.

Fake Edit: Yup.

That’s actually really cool & useful, I’m just “giving you the business” (as the kids say these days).

mod sassinator
Dec 13, 2006
I came here to Kick Ass and Chew Bubblegum,
and I'm All out of Ass

MrPablo posted:

It's just really, really humid here!

Seriously though, I think they must have multiplied the humidity precision in the kernel driver by 1000.

Fake Edit: Yup.

Yeah temps and most other values from the Linux hwmon and IIO subsystems (where those /sys/bus/... devices are being created internally) are in milli units (like milli-degrees, etc.) so you have to divide by 1000. It's a legacy thing--they wanted to use fixed point instead of floating point numbers long ago. You can learn more about the exact units from here (hwmon sensors): https://www.kernel.org/doc/Documentation/hwmon/sysfs-interface and here: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/ABI/testing/sysfs-bus-iio

MrPablo
Mar 21, 2003

mod sassinator posted:

Yeah temps and most other values from the Linux hwmon and IIO subsystems (where those /sys/bus/... devices are being created internally) are in milli units (like milli-degrees, etc.) so you have to divide by 1000. It's a legacy thing--they wanted to use fixed point instead of floating point numbers long ago. You can learn more about the exact units from here (hwmon sensors): https://www.kernel.org/doc/Documentation/hwmon/sysfs-interface and here: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/ABI/testing/sysfs-bus-iio

I should have phrased what I said better. What I meant to say was "the kernel driver must have been updated to change the precision in the reported value between when I originally created the web interface and when I took a screenshot today".

When I created the web interface, the temperature value was reported by the kernel driver in milli-units (as you describe above), but the pressure and humidity values were not. Here's my original conversion code:

code:
SENSORS = [{
  key:  'humidity',
  file: 'in_humidityrelative_input',
  func: proc { |v| v.to_f },
}, {
  key:  'pressure',
  file: 'in_pressure_input',
  func: proc { |v| v.to_f },
}, {
  key:  'temp', 
  file: 'in_temp_input',
  func: proc { |v| v.to_i / 1000.0 },
}]
Since I wrote the code above, the kernel driver was changed to report the humidity value in milli-units rather than fractional units.

MrPablo
Mar 21, 2003

Schadenboner posted:

That’s actually really cool & useful, I’m just “giving you the business” (as the kids say these days).

I deserve it for not fixing the bug when I took the screenshot :).

General_Failure
Apr 17, 2005
Re the TensorFlow issue. I managed to get it to install and be loadable on the Pi Zero W.
It was after a lot of poking at it. However I suspect the thing that worked was a new point release of pip3 appeared. Maybe the one I was using had a bug.

Regarding kernels I meant more using rpi-update which switches it from 4.14.98+ to 4.19.y

Hadlock
Nov 9, 2004

If you figure out how to get it working, maybe write it up as a docker file so others can use it, it's pretty small group of people using it, but now it's a turn key install

General_Failure
Apr 17, 2005

Hadlock posted:

If you figure out how to get it working, maybe write it up as a docker file so others can use it, it's pretty small group of people using it, but now it's a turn key install

I got past the hashing issue. Installing /updating wheel system wide using pip3 seems to have fixed it. I ran a simple test program in TF. It worked, besides the binary version warning on import. IIRC I also have keras, OpenAI, and possibly pybrain and opennn installed. Haven't got opencv working yet.

bolind
Jun 19, 2005



Pillbug
“Ho hum, better check that raspberry pi thread if someone replied, probably not...”

:stare:

That’s above and beyond guys, from the bottom of my cold, nerdy heart: thank you!

General_Failure
Apr 17, 2005
I found a github with prebuilt wheels for tensorflow 1.13 for a few architectures including arm64. These are the results for an Orange Pi 3 running Armbian Stretch with a mainline kernel.

I did the test that MrPablo had on the page. Not sure if having my /home, therefore the venv on an old notebook hard drive connected with a cheap USB3 adapter affected the result, but here it is:
code:
(tfk) general_failure@host:~$ time python -c "import tensorflow as tf;
tf.enable_eager_execution();
print(tf.reduce_sum(tf.random_normal([1000, 1000])))"
tf.Tensor(263.34903, shape=(), dtype=float32)

real	0m8.251s
user	0m7.925s
sys	0m0.456s

spiny
May 20, 2004

round and round and round
re: temp stuff, I use this:

https://temperature-machine.com/

and it's pretty good. the dev guy is good at responding to questions as well:

https://gitter.im/temperature-machine/Lobby?source=all-rooms-list

MrPablo
Mar 21, 2003

General_Failure posted:

I found a github with prebuilt wheels for tensorflow 1.13 for a few architectures including arm64. These are the results for an Orange Pi 3 running Armbian Stretch with a mainline kernel.

I did the test that MrPablo had on the page. Not sure if having my /home, therefore the venv on an old notebook hard drive connected with a cheap USB3 adapter affected the result, but here it is:
code:
(tfk) general_failure@host:~$ time python -c "import tensorflow as tf;
tf.enable_eager_execution();
print(tf.reduce_sum(tf.random_normal([1000, 1000])))"
tf.Tensor(263.34903, shape=(), dtype=float32)

real	0m8.251s
user	0m7.925s
sys	0m0.456s

That test should be CPU or memory bound, rather than IO bound. In other words, using an external hard drive shouldn't affect the run time by more than a second or so (particularly since the kernel will cache the files after the first run).

All that the code is doing is generating a 1000x1000 matrix of random, normally distributed floating point numbers, adding all of the numbers together, and then printing the result.

track day bro!
Feb 17, 2005

#essereFerrari
Grimey Drawer
How hard would it be to do something like this yourself

https://ukdepartureboards.co.uk/store/index.php/product/desktop-departures/

I saw this and thought it was pretty cool but not £160 cool. Realised that it's just using some form of PI to work and I have a model 2b sitting around from a pihole that I couldn't get to play nicely with my router.

How hard would it be for someone with 0 programming experience to get a little addon screen to display the departures of my local train station on the pi. It's just stupid little idea because then I'd know before I leave work if the trains are delayed which seems to happen every so often.

I found this https://github.com/DanteLore/national-rail and this http://digitalfantastico.blogspot.com/2013/01/a-big-bite-of-raspberry-pi-having.html so it seems like it's do-able. Would I be able to adapt something like this so I could use it?

mewse
May 2, 2006

track day bro! posted:

How hard would it be to do something like this yourself

https://ukdepartureboards.co.uk/store/index.php/product/desktop-departures/

I saw this and thought it was pretty cool but not £160 cool. Realised that it's just using some form of PI to work and I have a model 2b sitting around from a pihole that I couldn't get to play nicely with my router.

How hard would it be for someone with 0 programming experience to get a little addon screen to display the departures of my local train station on the pi. It's just stupid little idea because then I'd know before I leave work if the trains are delayed which seems to happen every so often.

I found this https://github.com/DanteLore/national-rail and this http://digitalfantastico.blogspot.com/2013/01/a-big-bite-of-raspberry-pi-having.html so it seems like it's do-able. Would I be able to adapt something like this so I could use it?

You've got two main hurdles, driving the display and scraping/parsing the data to push to the display. Neither of them should be insurmountable but the first one is a hardware problem and the second one is purely a software problem.

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS
Kinda challenging with zero programming experience, but maybe in the range of decent first project so I think you should go for it

track day bro!
Feb 17, 2005

#essereFerrari
Grimey Drawer
I think I'll start by looking at some of the example projects on the pi site first, this is gonna be like babby learns to code. Hopefully I should learn something haha.

Sagebrush
Feb 26, 2012

As long as you get a display that includes an I2C or SPI backpack of some kind (with 0.1" pins, not that clamped-on kapton tape bullshit) and you can find a library that purports to be able to drive it, you should be fine. The OLED displays in that departure board thing are pretty common and easy to work with. Search for "graphic oled" on eBay and you'll find tons of them.

The big problems arise when someone has some random display from a broken cell phone or whatever, with no documentation and no on-board driver and some teeny tiny custom connector with 80 microscopic pins and they only want to use it because they don't want to throw it out.

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS
don't dox me

track day bro!
Feb 17, 2005

#essereFerrari
Grimey Drawer
Heres a stupid question, how come I can't get this thing to boot unless I have a HDMI cable plugged in. If I just plug power in and network, it looks like its booting but I can't connect to it at all. If I have the HDMI plugged in it clearly boots and I can connect. I've got the basic raspbian image installed with it booting to desktop, with ssh and vnc enabled.

When I had it setup as a pihole I was using the basic terminal only raspbian and I could always connect to it via ssh. Can you not use it headless if you run a desktop, its funny because if I unplug the network cable I can see disk activity or if I plug in a usb device but it just doesn't appear on the network at all.

hambeet
Sep 13, 2002

Nah it should work.

I just set one up headless on the weekend. It's using latest stretch image and I've setup pixel and vnc can connect fine.

track day bro!
Feb 17, 2005

#essereFerrari
Grimey Drawer

hambeet posted:

Nah it should work.

I just set one up headless on the weekend. It's using latest stretch image and I've setup pixel and vnc can connect fine.

Nevermind I was just being a dumbass and it had changed ip address, I've given it a reserved one now.

General_Failure
Apr 17, 2005
Re: the departure thing, try looking on AliExpress for OLEDs. Most are driven by an SSD1306. I have some smaller i2c OLEDs which use that chip. So far I've used it with Arduino libraries, and with a driver in RISC OS on my Pi Zero. I'm fairly certain there are drivers for Linux too. The OLEDs are pretty cheap.

Kind of silly, but I realised today that the Grove AI HAT may be usable on the nVidia Jetson Nano dev board.

Adbot
ADBOT LOVES YOU

abigserve
Sep 13, 2009

this is a better avatar than what I had before
Looking for some help. I've got a relay switch (this one: https://www.iot-store.com.au/collections/components-accessories/products/2-channel-12v-relay-module) that is hooked up to the 5V output on the Pi.

The power led shows red, and when I send a high signal to the GPIO pin I've got connected to the channel, the green "channel" LED lights up but it's very faint and I only here a very faint clicking noise in the relay - the relay itself doesn't work, hence the problem.

Here's my question - the power supply I got with the Pi is actually broken, so I'm using a spare 5v 2amp charger I had lying around. However, this is slightly less than the provided spec (5.1v 2.5 amp) of the RPI 3 charger. Would that be enough to bugger the 5v output on the Pi and make it not able to drive the relay?

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply