RaspberryPi + LinkMeter blue sky discussion


 

Bryan Mayland

TVWBB Hall of Fame
Originally posted by Dave S (GeoDave):
I get my Raspberry Pi this week!

Bryan:

- Are you thinking of an Arduino shield that sits on top of the Raspberry Pi communicating through the SPI?

I found a Raspberry Pi library/footprint online. It would be pretty easy to redesign the existing v3.2 board to sit on top of the Raspberry PI.

I guess the alternative is a complete redesign of the entire system.

- If the Arduino is eliminated I think it would be pretty easy to design a shield to connect the sensors/blower/button to the GPIO pins but what about the LCD support?

I am trying to think how a 16x2 LCD could be implemented through the pins available on the Raspberry Pi...

20120521094840%21GPIOs.png


Since you are still volunteering your time to this project, I am assuming you will be writing a standalone program to run on the Raspberry Pi.

- What were thinking in terms of software? Similar interface? Maybe a standalone application in Debian?

- What about a case?

I heard the Pi is pretty delicate. I was thinking it would be cool to create a custom case for the Raspberry Pi plus shield when that designed. Maybe it could be posted to Shapeways and folks could order the design through that site. I read on their site that you can design cases using an opensource software called Blender. The LCD could sit on top of the shield with a button next to it. The button/LCD could be designed to stick out of the top of the custom case. The audio jacks and blowers could go on the side.

Anyway, just trying to get the conversation going. OR is this too costly for the original purpose?
Considering the cost of a WRT54GL, I think the cost of a RaspberryPi + WiFi dongle is in the same ballpark as a low cost homebrew controller.

I considered running everything directly from the Pi's ports but the LinkMeter specs I think requires the following:
-- At least 3 ADCs for probe inputs plus 4 digital inputs for buttons, or 4 ADCs.
-- A digital out for the LCD (which is driven over SPI currently)
-- A PWM out for the fan control
-- A PWM out for the alarm
-- Optional digital out for RFM12 and input for interrupt

I think it would be technically possible to do most of the required items, but I'd have to use an SPI or I2C ADC chip. That's going to probably be a 16-pin DIP chip that costs as much as the ATmega so the way I see it, it will probably be easier and more functional to just keep the current ATmega HeaterMeter configuration.

The PCB design I had been messing with would have the LCD and probe jacks mount directly to the board, and possibly even the button too. It was still up in the air how much I could squeeze in, but I've also built prototype cardboard mockups of various exterior dimensions to determine if side-by-side boards would work better with connectors. I should have mine inside of a month or so to be able to play with it. I'd also like to look at getting a smaller software installation for it too. It is amazing that OpenWrt is a somewhat complete ARM Linux server install that fits in 3MB and all the RaspberryPi ARM Linux installs are into the gigabytes.
 
Originally posted by Bryan Mayland:
it will probably be easier and more functional to just keep the current ATmega HeaterMeter configuration.

The PCB design I had been messing with would have the LCD and probe jacks mount directly to the board, and possibly even the button too. It was still up in the air how much I could squeeze in, but I've also built prototype cardboard mockups of various exterior dimensions to determine if side-by-side boards would work better with connectors. I should have mine inside of a month or so to be able to play with it. I'd also like to look at getting a smaller software installation for it too. It is amazing that OpenWrt is a somewhat complete ARM Linux server install that fits in 3MB and all the RaspberryPi ARM Linux installs are into the gigabytes.

Man this sub-forum thing confused me!

I figured as much on the design approach. I have been thinking about the PCB design as well. One of the big challenges is designing something that can sit on top of this thing. The GPIO pins are lower than most of the connectors. I am assuming you will want to go with a DIP and through-hole packages (though it would be fun to do SMD) so we will need a good amount of space. Perhaps the PCB board could wrap around the RCA jack and extend to the back of the Ethernet connector. The header pins between the RCA and mono jack could be used as a support. I think that support is important with the heavy LCD.

I was also thinking the LCD should mount directly on the top of the PCB. There is enough room if it is centered over the Pi board. I am a little concerned about clearance on the atmega328 chip. It would probably be best mounted on the reverse side of the PCB and towards the Pi.

I say stick with the multi-directional switch but mount it directly to the board and next to the LCD.

I would think you could squeeze the three PCB mounted mono jacks on the SD card side of the board. The fan connector should probably be mounted to the PCB as well, maybe on the HDMI side.

What were you thinking in terms of a case? It is going to need one. Maybe I could teach myself how to use that 3-D software and create a case. People could use 3-D printers to print out the case. Or maybe someone with some 3-D modeling experience will join the discussion.
 
proto1.png

Here is a quick layout with a couple components. Red is the board outline. There is not really a great place for the button.

proto2.png

LCD overlay...a little busy but you see the outline of the 16x2 LCD PCB.
 
A couple conceptual images with minimal components. Is this what you were thinking Bryan? It will be pretty tight. Button might need to go on the side.

Concept1.png


Concept2.png


Concept3.png


Concept4.png
 
Yeah the LCD really dominates the layout. In my mind everything would be mounted on the underside of the board, then the LCD would have some sort of connector that would allow you to attach it but remove it if needed. Note that my board is oriented 180 degrees from yours


I've got the 4x 2.5mm mono jacks, a 2.1mm barrel jack for the power input and an RCA out for the blower on the bottom. It would almost fit although I'm not sure about the clearances needed for components on the Pi board. Also note that this is all airwires and I doubt it would route at all.

Two other configurations I've considered:
1) With the HeaterMeter board offset from the Pi so we'd start after the USB jacks maybe and then hang over. This would allow the LCD to mount and extend off the top of the board, saving valuable space. Again there are possible clearance issues here with Pi components

2) Double tall. Instead of mounting directly on top, we'd be a separate 2"x3" board that would make the overall dimensions 4"x3" using a ribbon cable to connect to the Pi expansion and probably having a button/LCD separate board. The device stays thinner so it still feels tiny (I have a mockup), but mounting the boards in an enclosure and getting them to stay put might be tougher.

As far as a case goes, I was of course planning to do a cardboard case! Once everything seemed finalized I'd probably try to find a 3D printer or use one of those sites that makes custom enclosures... the name of the site escapes me at this time.
 
You are right. Clearance is important. I have been trying to get the correct dimensions into Google Sketchup using my digital caliper. Hopefully that will help avoid clearance issues.

Concept5.png

This is an image of a general mono jack that is 5mm deep. I am not sure how deep the mono is you used. If it is deeper than 6mm it probably won't work.

Concept7.png

You only have 7.6mm to work with between the RCA and mono audio jacks. It would probably be hard to squeeze another RCA.

Concept6.png

There is room for components of the underside but they will have to be carefully placed.

I don't think the board can be the same size of the Pi board due to clearance issues with the USB and LAN jacks. Unless you have an idea how how to raise the PCB higher off the Pi board.
 
Wow that is some really impressive Sketchup work and really helps to visualize what's not going to fit where. I'm pretty sure it will be impossible to fit all the components on the underside mounting it that way, unless we switch to surface mount and I'd like to avoid that to keep it accessible to people with no soldering experience. I'm thinking a layout like this maybe, with all the components on the underside of the board.


I certainly do not have the sketchup expertise to draw that but I think it would be better to go wider than stacking higher, because you're still going to lose all that usable area to the LCD if you try to maintain the same footprint. What do you think?
 
I usually don't lose my temper but I am getting close with this Raspberry Pi. It looks delicious and smells delicious but when you actually take a bite of the Pi it is apparent that grandma dropped something unsavory in there. I am having some serious issues with the Pi's touchy USB polyfuse (I think). If you Google around you will find others having USB power issues. This issue alone is going to make it very difficult for kids to use. Anyway, if I can get a keyboard to work long enough I am going to try to enable SSH so I don't have to worry about KEYBOARDS!!!!!! AHHHHH!!!

Also, for the user interface, why not just install an Apache sever and code up some html. Python has a nice API (pyserial) that lets you easily pull data from the serial port. I have played with it a little bit and can get the Arduino serial data to print to my index file on the Apache server. Thoughts?
 
I was shying away from using Apache because I can't use that for existing users therefore all the code would diverge into two codebases that wouldn't support the same features. The idea being that if I can get one codebase that works on both platforms it would be easy to work on and run fast as **** on the Pi.

I'll get my Pi tomorrow so I'll soon be sharing your joy. I think it is going to be a REAL problem with a 160mA polyfuse because any WiFi adapter is going to pull probably closer to 200mA to transmit.
 
A little closer to a usable design (white=top, yellow=bottom)
PS3Up.png


This incorporates the button board, LCD mount, probe, power, and blower mounts onto a board that mates with the expansion header on the Pi. It mounts in an offset sort of layout that will give us the same width dimension and roughly double the height of the Pi with a minimum depth increase. I'm not sure about some of the clearances so I'll be printing some 1:1 mockups to test out. There's also some extra space I'm hoping to be able to move around and make a few holes for screws that can be attached to standoffs glued into whatever case we design.

In software news: I've got OpenWrt compiling for RaspberryPi! I can't test it yet to see if it boots or works at all though. Once that works I think I can build LuCI easily and bam we're up and running.
 
You're up and running... I got notification that I should be able to order sometime in August with a 12 week lead time. And that's just for the B model.. Lame!
 
Ha! I am so pleased I just had to come post about it. I've fixed the build errors with rrdtool's automake which was preventing it from building and now linkmeterd, rrdtool, LuCI / lucid builds for the RaspberryPi target. At least I think it does, I mean it makes a firmware image that I can write to an SD card. Still won't know if it actually boots or runs until tonight.

The SD image is 12MB for the Pi booter and 7.6MB for the OpenWrt root file system. I think I can get the Pi bootsection down to about 6MB too and have the whole thing fit in under 14MB. Much better than the 700MB default RaspberryPi (because I don't know where I'd even host a 700MB LinkMeter distro)
 
Originally posted by Bryan Mayland:
Ha! I am so pleased I just had to come post about it. I've fixed the build errors with rrdtool's automake which was preventing it from building and now linkmeterd, rrdtool, LuCI / lucid builds for the RaspberryPi target. At least I think it does, I mean it makes a firmware image that I can write to an SD card. Still won't know if it actually boots or runs until tonight.

The SD image is 12MB for the Pi booter and 7.6MB for the OpenWrt root file system. I think I can get the Pi bootsection down to about 6MB too and have the whole thing fit in under 14MB. Much better than the 700MB default RaspberryPi (because I don't know where I'd even host a 700MB LinkMeter distro)

Awesome! I am still having issues with my board. I hope you don't run into the same problems. It seems to be some type of USB hub issue and it has been widely reported on the forums. Apparently the Raspberry Pi Foundation is looking at the issue. Hopefully most of these issues (aside from the small polyfuse) is software related and can be addressed through future builds.

Let me know how it does tonight. Once you got something working I will be happy to test it on my Pi. I am assuming the build will be configured so that you can SSH into the Oepnwrt. I have been having issues with my LAN too so I may not be able to SSH but at least it is another build I can test to prove or disprove the hardware issue.
 
Good news everyone, it works! OpenWrt is up and running in 12.8 seconds after you plug it in. The LuCI web UI is a lot faster. A *lot* a lot in some places. Serial communication to a HeaterMeter board also works although my rrdtool didn't seem to build 100% right so the linkmeterd crashes on startup. There's a lot of polish missing too, I had to plug in a HDMI monitor and a keyboard (first one didn't work despite showing up in the dmesg) because the networking didn't start automatically.

I need to get a better test setup working too because now I'm sitting on my living room floor, the only location within cable's reach of A) a network jack B) a power outlet C) an HDMI display. This is uncomfortable as heck!
 
I figured I'd get an HDMI -> DVI cable when I get mine so I can use an old monitor I have laying around and not have to plug it into my TV.

Have you figured out what kind of WiFi dongle you are going to use? I think I have an old 802.11g one laying around somewhere I was hoping I could use, but I wasn't sure if OpenWRT would support it.
 
Good to hear that things are progressing (faster than the process of getting hold of a Pi here in the UK.

I understand that the Pi version will likely spawn a new PCB layout to make the whole 'package' neat. Is it the working assumption that a current Heatermeter (v3.x) will be able to integrate with the Pi (all be it with a slightly less elegant board alignment)?
 
@Kyle: I have given it some thought and bought a Rosewill RNX-MiniN2 because it was small and was on sale for $9, but its support even under Ubuntu was non-existent and required me to build my own kernel module which didn't work without some modification. There's a bunch built on Realtek RTL81xx chips which have drivers but apparently the differences between manufacturers is so great that even if the device has an rtl8192cu in it, the rtl8192cu kernel module won't work. OpenWrt runs on the Linux 3.3 kernel so it has support for all the latest and greatest. The key is going to be finding a device that the kernel module compiles for ARMv6. EDIT: Actually it loos like it might actually be supported in 3.3.2 and OpenWrt is 3.3.8? In any case, the point is there should be kernel support for *many* WiFi adapters.

@Nick: It is possible to use an v3.x HeaterMeter board and hook it up to a Pi, I can't come up with a reason it wouldn't work with some effort. You'd probably have to replace the 5V linear regulator with something a little beefier like the switching regulator I've got for the Pi version (because you've got to supply 5V 600mA for the Pi as well). In the end I'd probably recommend just building a new board and using some of your old components like the LCD and ATmega, but if you can work out a stable way to raft the two boards together, it would probably work. :whisper: To test last night, that's what I did (plugged the 3.3V/GND into 5V/GND on the LCD connector, and hooked Rx/Tx directly to the ATmega with clips)
 
Hey, that's awesome to hear, Bryan. I'm very much looking forward to doing a build with the Rasp Pi.
 
Originally posted by Bryan Mayland:
There's a bunch built on Realtek RTL81xx chips which have drivers but apparently the differences between manufacturers is so great that even if the device has an rtl8192cu in it, the rtl8192cu kernel module won't work.
Nice, I checked the device support and the driver showed as supporting it so I built all the kernel modules and loaded them and it locks Linux up when rtl8192cu loads. I may try it again except with it attached through a hub to make sure it is getting enough power.
 

 

Back
Top