Access Raspberry Pi to read data.

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller

ghettocottage
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 306
Joined: Tue Apr 10, 2012 9:18 am

Re: Access Raspberry Pi to read data.

Post by ghettocottage » Sun May 05, 2019 5:08 am

Just a thought:
It would not be too complicated to create (with some help) a bash script that runs on your pi that would ssh into your webserver and write all the data to a file there.

Your webserver could then do the rest with that file.

The script on the pi could run on a schedule of however frequently you wanted it to, but creating a cron-job.

That might simplify things a bit. and you would not have to mess with the pi much once the script was working.

revRider
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 43
Joined: Sat Apr 02, 2011 4:06 pm

Re: Access Raspberry Pi to read data.

Post by revRider » Tue May 07, 2019 2:00 pm

Yes.. That is possible..

My main goal was to do most of the heavy lifting using LiveCode.

Since I can't program using LiveCode on the Pi, I figured using a desktop, to do a reach around to gather the data , parse then pass to server, might be possible.

Otherwise I could do everything with the pi using python and php. But the end result wouldn't be as pretty, or as easy to share with the community.

~David

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6627
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Access Raspberry Pi to read data.

Post by FourthWorld » Tue May 07, 2019 2:16 pm

You could conceivably use LC 7.0.4 for the Pi deployment.

But as for your original strategy, it sounds like you have everything you need except login. Setting up a shared key, putting the public key on the Pi, should accomplish what you need.

https://www.digitalocean.com/community/ ... sh-keys--2

With that, you could login, and call whatever's need to obtain the data, from LC's shell function.
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

revRider
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 43
Joined: Sat Apr 02, 2011 4:06 pm

Re: Access Raspberry Pi to read data.

Post by revRider » Wed Jun 12, 2019 10:43 pm

Would love to deploy/run LiveCode on a Raspberry Pi, it is one of the features I've supported and paid/donated for for years. Think the Pi would be a great tool for low cost, remote (disposable) computers. Now with wifi, they are easy to deploy in the field and communicate with. However getting data too and from the Pi reliably has been an issue. - All as a teaching tool.

Know I was able to get LiveCode/RunRev on a Pi years ago, think in version 3 or 6. But files couldn't be compiled.

Tried version 7.0.4, no RPI version. Got excited there for a minute.

Just trying to get the data collected from the Pi, to either another computer or Server, without having to jump through a lot of unnecessary security hoops. Just saying. It is so easy to reimagine a pi, and you really have to when the computers can be broken (child handled to death). -- If the program could be compile using LiveCode on a raspberry Pi, it could be started on reboot and start sending data to a database (server). yes I know data could be collected on pi. But the Pis tend to die/crash/SIM Death..

We have data being collecting from weather sensors that needs to be distributed, or sent elsewhere for the students to access. (ROFL) Don't think it would be a good idea to let students access 1 pi all at once, while it is collecting data.

Tried the key sharing, ended up hosing a couple of pis and wasting lots of time. Was never able to do anything constructive going that direction. Again, just saying.

Know everyone is trying to help. Thank You.

Guess I need to parse the data and send to LiveData, then figure out how to use LiveData to release the data to students. (IF I can do that from a Raspberry Pi). Sounds fun. (gag) LOL -- Again the data is on a pi with an Arduino, with weather shield, plus AcuRite weather stations sending data to a pi collecting data off 433 mhz sensors.. So in total 3 weather stations, 2 Pis. (but think once I figure out data collections the number of Pis isn't important).

ghettocottage
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 306
Joined: Tue Apr 10, 2012 9:18 am

Re: Access Raspberry Pi to read data.

Post by ghettocottage » Wed Jun 12, 2019 11:21 pm

I have a project I am working on that involves an OrangePi set up out in a field (literally out in a field) and I use one of these things: https://hologram.io/nova/ plugged into the Pi to send small chunks of data to a server where I have Livecode Server running...which collects that data and does a few things with it.

So far so good. I am having to re-do my first attempt because of some voltage issues with my electrical wiring, but other than that everything is working. In fact, I purchased a RaspberryPi Zero to replace the OrangePi, since I did not need a big ethernet port jutting out.

I am fairly confident that I could do a weather-station using the exact same setup I have now.

revRider
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 43
Joined: Sat Apr 02, 2011 4:06 pm

Re: Access Raspberry Pi to read data.

Post by revRider » Thu Jun 13, 2019 3:26 pm

That would be cool. But since I'm only a computer teacher, and most of the funds come out of my pocket, the Cellular solution is out of my budget (could end up needed two as well)... I have been thinking about trying 433mhz, very cheap add-on boards.

Using 433mhz and sending the data serially, I could send data to almost anything, including a computer that supports LiveCode. At the moment that is the direction I am trying. Unsure if my skill set will pull us through but I'm going to try.

ghettocottage
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 306
Joined: Tue Apr 10, 2012 9:18 am

Re: Access Raspberry Pi to read data.

Post by ghettocottage » Thu Jun 13, 2019 4:02 pm

In my original setup, I had an old Linksys WRT54g router with a couple of large antennas. You can find those routers at thrift-stores for a few dollars and install dd-wrt on them. The antennas un-screw and can be replaced with larger, more powerful antennas. That router can be ran on 12v (solar panels or auto battery) and is very forgiving of any voltage surges (probably the reason they were notorious for being such tough routers)

I was able to have that setup out roughly 100 yards from a house that had wifi. I think my only expense was the antennas from eBay.

The only reason I had to switch to the nova modem was I needed a lot more distance away from any internet source.

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”