User avatar
Jim Manley
Posts: 1600
Joined: Thu Feb 23, 2012 8:41 pm
Location: SillyCon Valley, California, and Powell, Wyoming, USA, plus The Universe
Contact: Website

Re: Digital Geology

Sun Mar 11, 2012 7:09 pm

I would also recommend using the R-Pi as the sensor host and have it transmit data via a web server running on the R-Pi over WiFi to devices like smart phones and tablets with much better displays than will likely be available for the R-Pi at a reasonable cost for some time.  Note that cost includes time/effort to integrate hardware, software, and a case/packaging, and to troubleshoot - never as easy as some make it sound who have never had to do it.

Someone mentioned Bluetooth having a range of ~100 meters - it's actually about 10 meters, while WiFi can easily reach well over 100 meters, and upwards of a kilometer line-of-sight outdoors in an area with low RF interference (the world record using large directional antennas is around 200 miles between mountaintops!).

There are a number of USB-wired and Bluetooth wireless external GPS "pucks" designed for use with laptops for recreational aviation and off-road vehicles that provide more accurate position and elevation data than smart phones and tablets for as little as $35 (more expensive newer models also include accelerometers and compasses).  I'd have to check to see if they come with drivers for Linux, especially source code if there are differences between Linux variants that require tweaking (e.g., R-Pi being ARM-based, while most Linux drivers assume x86).

BTW, NMEA-0183 is a data protocol, not a hardware interface as USB and RS-232 are, and it can very happily be used over either hardware interface.

I'll be following these efforts with a lot of interest just to see what can be done.
The best things in life aren't things ... but, a Pi comes pretty darned close! :D
"Education is not the filling of a pail, but the lighting of a fire." -- W.B. Yeats
In theory, theory & practice are the same - in practice, they aren't!!!

Andre_P
Posts: 241
Joined: Sun Aug 28, 2011 7:57 am

Re: Digital Geology

Sun Mar 11, 2012 7:47 pm

@Jim Manley : Yup I appreciate it's data protocol, I remember seeing some of the sentences over the serial link, however it is interesting that it is viewed as a serial data stream idea within the driver world by the looks of it .

bjs
Posts: 26
Joined: Thu Mar 08, 2012 10:51 am

Re: Digital Geology

Mon Mar 12, 2012 8:06 am

@Winwaed

Don't worry about digressing. At this stage in the game, i.e. waiting for RPi, its good to think laterally about what can be done. The open source movement has always had the concept of re-usability so designing something that can be used for many different applications is better than a stand alone.

There are quite a few sites on the net where people have built proton magnetometers; have a look at:

perso.infonie.be/j.g.delannoy/BAT/PracticalBuildingGuidelines.pdf

This is one of the more sophisticated ones and uses quite a bit of electronics. I have not looked at it in detail but it may be possible to replace some by software.

Resistivity is relatively simple but I seem to remember that large power supplies/generators are needed? I seem to remember that there are some good archeology sites for it but would have to look.

I have not looked at gravitometers since I was a student but I seem to remember that they used quartz springs which are not easy things to make. Maybe there are better ways by now?

For seismic the problem would be the geophones. But I have just found this on youtube:



? 8:46? 8:46
http://www.youtube.com/watch?v.....7897s8BDfc

and there seem to be quite a few more on googling 'diy geophone'. Maybe worth a look and a try.

As far as analysis goes, there are some very good open source mathematics apps; SAGE is a Mathematica/Maple clone, Octave is a Matlab clone. They have some very sophisticated graphics and things like DFTs are no problem. There may well be open source geophysics code for these platforms out there.

Tech_Monkey's site give a tablet for £46 which is even better. However, I did some reading of reviews on cheap Android tablets and its not too clear what processor they are using. Some of the more expensive tablets, ca. £150, have ARM processors and have had Debian mounted on them in dual boot with Android. From a practical point of view this seems desirable since it means that a much wider range of existing software/languages can be used. With Android you have to work with Java. I don't know Java but I think that there are APIs for using C, python etc. but I would rather not have to go to the trouble of learning another language just at the moment. Most negative comments I have seen about the cheap tablets concern not being able to play various games on them. If anyone knows about getting Linux on these cheap tablets please let me know. For the moment I will concentrate on the RPi/instrumentation side I think.

bjs
Posts: 26
Joined: Thu Mar 08, 2012 10:51 am

Re: Digital Geology

Mon Mar 12, 2012 8:22 am

Jim Manley said:


There are a number of USB-wired and Bluetooth wireless external GPS "pucks" designed for use with laptops for recreational aviation and off-road vehicles that provide more accurate position and elevation data than smart phones and tablets for as little as $35 (more expensive newer models also include accelerometers and compasses).  I'd have to check to see if they come with drivers for Linux, especially source code if there are differences between Linux variants that require tweaking (e.g., R-Pi being ARM-based, while most Linux drivers assume x86).



In Linux devices are treated as file systems. You usually will not find device drivers listed since USB and Bluetooth devices should work straight out the box with the kernel drivers that Linux supplies. However, Linux drivers tend to come in two parts; the generic kernel driver and another part in user space. Even if Linux can read your device you need to know the data format and its sorting that side out that goes in the user space part of the driver. For things like printers and scanners manufacturers are often reluctant to supply the necessary information and people resort to using packet sniffers (free download) on a machine with a Windows driver to figure out what is doing what. At device level information is usually available. For things like GPS I think the formats are standardized.

BTW there used an MIT open courseware course on GPS. The homework part was in writing GPS software.

poing
Posts: 1131
Joined: Thu Mar 08, 2012 3:32 pm

Re: Digital Geology

Mon Mar 12, 2012 8:31 am

Interesting discussion. I have no knowledge in the geology field but I have some experience with cheap Android devices. One important thing: forget seeing anything on the screen in daylight

error404
Posts: 351
Joined: Wed Dec 21, 2011 11:49 pm

Re: Digital Geology

Mon Mar 12, 2012 9:52 am

bjs said:

Its just a black box and is not open source so I can't do much with it.
The drivers are generally closed, but the entire rest of the OS is open source. If the interfaces don't give you what you need (there's no access to precise time from GPS, for example) then you'll definitely have to do something else. But for basic position / heading / acceleration / angular momentum, it's all there in easy to use APIs. Sensor quality and wanting to use existing C code notwithstanding, of course. There's also the ADK API to connect your own gadgets to an Android device's USB OTG port.

Nothing wrong with the using the Pi to aggregate data, you could really just make it a web app and do everything on the Pi, which you can then access from a PC or tablet or whatever - but you could also do it all on the Android device itself if you wanted.

bjs said:

In Linux devices are treated as file systems. You usually will not find device drivers listed since USB and Bluetooth devices should work straight out the box with the kernel drivers that Linux supplies. However, Linux drivers tend to come in two parts; the generic kernel driver and another part in user space. Even if Linux can read your device you need to know the data format and its sorting that side out that goes in the user space part of the driver. For things like printers and scanners manufacturers are often reluctant to supply the necessary information and people resort to using packet sniffers (free download) on a machine with a Windows driver to figure out what is doing what. At device level information is usually available. For things like GPS I think the formats are standardized.
Wow, you couldn't be much more wrong on this. In Linux, devices are generally presented as nodes in the filesystem, this has nothing to do with the drivers or kernel other than it's the standard UNIX way of accessing hardware. USB devices do indeed need drivers (beyond USB itself, of course), however there are many class drivers that are specified as part of the USB standard (like the Mass Storage Class - external storage device) which any OS should include drivers for. However anything that is not part of the USB standard will need a driver, and that includes lots of stuff, including lots of stuff that some vendor decided to reimplement rather than using the standard.

One place that's common is in USB->serial chips - there are dozens of different protocols, as well as a standard USB one, but most vendors seem to use their own for whatever reason. I've never come across one that Linux doesn't have a driver in the kernel for, but they probably do exist. It'd be worth trying to figure out which chip is used before you invest any money, or you could just buy a TTL UART one and not worry about it, and save a USB port to boot and they're usually cheaper.

You can write user-space USB code these days with libusb, but it's not very common beyond quick hacks or single-purpose hardware, and certainly not anything in the kernel. USB device drivers, for better or for worse, still run in kernel space.

bjs
Posts: 26
Joined: Thu Mar 08, 2012 10:51 am

Re: Digital Geology

Mon Mar 12, 2012 11:11 am

@error404

Many thanks for putting me right. One of my main reasons for playing with the RPi is to try to learn something about drivers and the kernel

bjs
Posts: 26
Joined: Thu Mar 08, 2012 10:51 am

Re: Digital Geology

Mon Mar 12, 2012 11:21 am

poing said:


Interesting discussion. I have no knowledge in the geology field but I have some experience with cheap Android devices. One important thing: forget seeing anything on the screen in daylight



Yes that's a worry. Its why I was thinking about the eInk screens but that probably means a lot of work. Also they are not touch sensitive so I would need a keyboard for data entry probably?

I seem to have a lot of conflicting requirements and as I said earlier I think I'm going to start with something relatively simple to start with and see how I go.

poing
Posts: 1131
Joined: Thu Mar 08, 2012 3:32 pm

Re: Digital Geology

Mon Mar 12, 2012 11:35 am

My plan to interface with the Pi is attaching a wifi dongle and installing a webserver. Then I can use buttons and stuff on the webpage using the browser of my Android phone to send text and commands to the Pi. This has it's limitations especially if you want to have real time continuous interaction but is otherwise very simple to create.

Here's a Sony e-ink reader with touchscreen, wifi and a webbrowser: http://www.the-ebook-reader.co.....-wifi.html

$129 @ Amazon: http://www.amazon.com/Sony-PRS.....038;sr=8-2

poing
Posts: 1131
Joined: Thu Mar 08, 2012 3:32 pm

Re: Digital Geology

Mon Mar 12, 2012 12:08 pm

Thinking about this further: It's possible to have continuous interaction between a webpage and the server although there's a (small) time lag. The technique used is called 'Ajax'.

A good example is the way Synology NAS servers are used. This NAS server is a small box using a CPU comparable to the one in the Pi and which contains a number of hard drives for storage. A number of programs are baked in, one of which is a torrent client. You control it from your PC using a browser and you can see, among others, the CPU load and memory used in real time.

A live demo can be started here, although the time lag is massive due to the distance over Internet: http://www.synology.com/produc.....p?lang=enu

Coding Ajax is not that easy but doable.

Youtube video showing the webbrowser: 

winwaed
Posts: 19
Joined: Wed Mar 07, 2012 9:13 pm
Contact: Website

Re: Digital Geology

Mon Mar 12, 2012 12:59 pm

@bjs The magnetometer looks like it could be a possible peripheral project.

re. geophones: After seeing the seismometer thread I went looking online and someone had some used ones for sale - they were using them as a hobby seismometer (local earthquakes only, of course). However, for field active seismology, I remember the kit we used as students. There was a big control box complete with LCD and thermal printer (this was about 20 years ago) - not that heavy but definitely large - luggable. The bulk of that could be powered by a RasPi. You would still need a good A/D converter and multiplexing circuit. Some kind of integral display panel, and the printer would be optional.  And sufficient battery voltage for geophones 100m or so away. Still with a Raspi, I think we're talking sub-brief case, rather than "fit under a desk" - and again, a fraction of the cost. And with a modern display, it could easily be programmed to do some in-the-field refraction interpretation.

re. gravimeters: I think you're right. I still think they're amazing devices, but extremely delicate and you pay for that sensitivity.

re. resistivity: I'm trying to remember back to student days. We always had a "base station" (incl. recording equipment and 2 electrodes for the archaeology stuff). Not connected to mains or a generator, but it was almost certainly a lead acid battery, and probably an inverter (iirc they use AC to avoid electrolytic effects).

bjs
Posts: 26
Joined: Thu Mar 08, 2012 10:51 am

Re: Digital Geology

Mon Mar 12, 2012 5:52 pm

@poing,

I'm not sure that this will be any good for me since I can't guarantee being able to access the web in the field. Mobile phone coverage is patchy out in the sticks particularly in mountainous country. Or have I misunderstood what you are proposing? Do you mean a local connection via WiFi?

I'm very impressed by the Sony eReader screen. My Kindle is not touch sensitive. This sort of screen would be great for field use since you could have a virtual keyboard. Do you know if you can programme the eReader yourself?

bjs
Posts: 26
Joined: Thu Mar 08, 2012 10:51 am

Re: Digital Geology

Mon Mar 12, 2012 6:02 pm

winwaed said:


@bjs The magnetometer looks like it could be a possible peripheral project.

re. geophones: After seeing the seismometer thread I went looking online and someone had some used ones for sale - they were using them as a hobby seismometer (local earthquakes only, of course). However, for field active seismology, I remember the kit we used as students. There was a big control box complete with LCD and thermal printer (this was about 20 years ago) - not that heavy but definitely large - luggable. The bulk of that could be powered by a RasPi. You would still need a good A/D converter and multiplexing circuit. Some kind of integral display panel, and the printer would be optional.  And sufficient battery voltage for geophones 100m or so away. Still with a Raspi, I think we're talking sub-brief case, rather than "fit under a desk" - and again, a fraction of the cost. And with a modern display, it could easily be programmed to do some in-the-field refraction interpretation.

re. gravimeters: I think you're right. I still think they're amazing devices, but extremely delicate and you pay for that sensitivity.

re. resistivity: I'm trying to remember back to student days. We always had a "base station" (incl. recording equipment and 2 electrodes for the archaeology stuff). Not connected to mains or a generator, but it was almost certainly a lead acid battery, and probably an inverter (iirc they use AC to avoid electrolytic effects).



I'm told that the problem with proton magnetometers is that they are too sensitive but I would have thought that that could be overcome.

I think I have posted already somewhere but the trick with the ADCs is to use a range changing amplifier that matches the gain to the signal strength. That way you can use a cheap ADC and still have a large dynamic range. I'm not sure but I think that for near surface work you would need a reasonably large band width as well so that would have to be taken in to account in your design.

My knowledge of all this is from about 40 years ago so I may be a bit out of date!

bjs
Posts: 26
Joined: Thu Mar 08, 2012 10:51 am

Re: Digital Geology

Mon Mar 12, 2012 6:10 pm

Its nice to kick ideas around but I'm getting the feeling that I'm getting in over my head with a lot of the computing. I still only have a vague idea of what software is going to be needed to get things talking to each other. I know I've got a lot to learn but at the moment I'm not sure what. It kind of makes me feel uncomfortable.

poing
Posts: 1131
Joined: Thu Mar 08, 2012 3:32 pm

Re: Digital Geology

Mon Mar 12, 2012 8:10 pm

bjs said:


@poing,

I'm not sure that this will be any good for me since I can't guarantee being able to access the web in the field. Mobile phone coverage is patchy out in the sticks particularly in mountainous country. Or have I misunderstood what you are proposing? Do you mean a local connection via WiFi?

I'm very impressed by the Sony eReader screen. My Kindle is not touch sensitive. This sort of screen would be great for field use since you could have a virtual keyboard. Do you know if you can programme the eReader yourself?


You did misunderstood me, I'm talking about a local connection over wifi without Internet.

Using my idea the Pi has a wifi dongle that is used to create an 'ad-hoc' (Google!) network with your phone/pad/computer. The only requirement is the distance between the eReader and the Pi, outdoors line of sight maybe max 30 meters (depending on hardware and conditions). No Internet access is necessary. You install the basic 'LAMP' (Google!) configuration on the Pi, which is probably already live when you compile the standard Fedora SD.

What you do (from the LAMP installation) is use the Apache webserver on the Pi to serve webpages that contain a mix of html and php code, while all you put into the system is recorded by the MySQL database. This is the basis of 75% of the Internet so it's extremely well documented and about the easiest way to go about interacting with a server. You use it reading this message.

'LAMP' is the working combination of apache, php and mysql. php is the programming language that is mixed with plain html to show the web pages, takes care of putting data in the MySQL database and can start any program or interface on the Pi.

If the e-ink reader is good enough visually for your goal and you don't need constant immediate real-time updates (I mean that it's no problem to refresh the web page manually to look at changed data) then I'd urge you to go this route as it's basically a breeze to get it to work and modify compared to other systems, like interfacing a monitor with the Pi directly.

Better understanding of the concept will no doubt evolve when you Google 'LAMP'. Do not try to  program the reader, just use it as a dumb visual interface as it's meant to be.

sesss
Posts: 4
Joined: Tue Jan 03, 2012 9:58 am
Contact: Website

Re: Digital Geology

Mon Mar 12, 2012 11:32 pm

I have no knowledge in the geology field but I have some experience with cheap Android devices. Just remember: forget seeing anything on the screen in daylight

poing
Posts: 1131
Joined: Thu Mar 08, 2012 3:32 pm

Re: Digital Geology

Tue Mar 13, 2012 12:15 am

sesss said:


I love the games for r4i dsi xl.


Still my guitar gently weeps...

http://www.youtube.com/watch?v.....t94nXinWqs

bjs
Posts: 26
Joined: Thu Mar 08, 2012 10:51 am

Re: Digital Geology

Tue Mar 13, 2012 8:02 am

poing said:



What you do (from the LAMP installation) is use the Apache webserver on the Pi to serve webpages that contain a mix of html and php code, while all you put into the system is recorded by the MySQL database. This is the basis of 75% of the Internet so it's extremely well documented and about the easiest way to go about interacting with a server. You use it reading this message.

'LAMP' is the working combination of apache, php and mysql. php is the programming language that is mixed with plain html to show the web pages, takes care of putting data in the MySQL database and can start any program or interface on the Pi.


OK thanks for the clarification. I'll have a look at LAMP. I know about the php/mysql/Apache process but have never done any web programming myself.

One thing I need to do is to enter some qualitative data like is the rock a limestone or a sandstone. Can I do that in php? I was going to do it using python/qt or with FreePascal or something like that. Well within my own programming comfort zone! That's why I was asking about programming the Sony eReader. This looks very interesting, thanks again.

poing
Posts: 1131
Joined: Thu Mar 08, 2012 3:32 pm

Re: Digital Geology

Tue Mar 13, 2012 1:08 pm

Why sure, you get values from anything on a webpage (text fields, check boxes, combo boxes) in php variables. All you need is basically three php commands:

select - retrieve values from the database to show on the webpage

insert - put values in the database from user input

shell_exec - start phyton script

Dead easy, even I can do it

RMW5
Posts: 47
Joined: Fri Dec 23, 2011 4:31 pm

Re: Digital Geology

Wed Mar 14, 2012 1:05 pm

If you wait long enough the price on hardware usually drops to fit your budget.  Here is a £92 7-inch HDMI touchscreen with Linux drivers that should work with a mobile R-PI straight out of the box with (OK, with a driver install).  Need to add £20 shipping + 20% VAT

http://www.chinavasion.com/pro.....v-input-2/

bjs
Posts: 26
Joined: Thu Mar 08, 2012 10:51 am

Re: Digital Geology

Thu Mar 15, 2012 6:48 am

Thank you RMW5. Its clear that the market is developing very rapidly for mobile and other embedded devices so the range of choice open to us is is going to grow. At some time I will have to make a firm choice and compromise between the various competing options. Things like size, weight, view-ability in sun and rain, programmability and practicality of a two piece or one piece device will all come into the equation. Clearly these choices are going to be specific to any particular application.

User avatar
Jim Manley
Posts: 1600
Joined: Thu Feb 23, 2012 8:41 pm
Location: SillyCon Valley, California, and Powell, Wyoming, USA, plus The Universe
Contact: Website

Re: Digital Geology

Thu Mar 15, 2012 9:09 am

Be aware that running a full LAMP stack on the R-Pi might be a bit much, and you might not be able to run much else at the same time, if needed (and is certainly overkill for what you want to do).  I don't have the links handy, but, there are lightweight alternatives to Apache and MySQL (PHP isn't bad resource-wise, so, any implementation will do, including the one that comes with the current LAMP installation).  The principles are identical, however, so, you'll just need to adjust a few things syntax-wise (all in the SQL database calls - a web server is just a web server, at the standard HTTP level - most of the extra Apache features are completely unnecessary for this use).  I'll post links to the lightweight alternatives when I have time to find them.
The best things in life aren't things ... but, a Pi comes pretty darned close! :D
"Education is not the filling of a pail, but the lighting of a fire." -- W.B. Yeats
In theory, theory & practice are the same - in practice, they aren't!!!

poing
Posts: 1131
Joined: Thu Mar 08, 2012 3:32 pm

Re: Digital Geology

Thu Mar 15, 2012 10:26 am

Good point Jim. I'm very interested as well in these links although I can guess.

Danbury Shakes
Posts: 15
Joined: Thu Apr 12, 2012 8:41 am

Re: Digital Geology

Thu Apr 12, 2012 1:29 pm

SQL Lite would be a reasonable substitute for a full blown SQL server.

It gives a complete SQL database in a small library and has bindings for both python and php and stores the entire database in a single file.

My  Yopy (a long defunct Linux PDA running on a StrongARM processor with 32 mb memory) used to run the Boa web server.

there's a wikipedia page on lighweight web servers

http://en.wikipedia.org/wiki/C.....eb_servers

Parkview
Posts: 58
Joined: Sun Feb 17, 2013 1:51 pm

Re: Digital Geology

Sun May 05, 2013 2:43 pm

How did you go with this RPi data logging project?

I am looking to do something similar. I have tried various iPhone GIS apps, but they come up wanting and can't afford a $2000+ Trimble as this is just being done as a hobby. Also, it's a pain typing into such a small screen.

I have been experimenting with the Adafruit Ultimate GPS and can't wait for the RPi camera to be released.

All the best.

Return to “Other projects”