Page 1 of 4

Raspberry Pi ...

Posted: Sun Aug 25, 2013 8:34 pm
by robin
If anyone has bought such a thing and now has it languishing in the back of a drawer, I am looking for one to experiment on but the nature of the experiment precludes me spending any money on buying a Pi :-)

Feel free to send via SE Pony Express or wrap it in a jiffy and send royal mail ... I will return said Pi should you feel the need to put it back in your drawer :-)

Cheers,
Robin

Re: Raspberry Pi ...

Posted: Tue Aug 27, 2013 11:14 pm
by campbell
New ECU?!

Re: Raspberry Pi ...

Posted: Wed Aug 28, 2013 7:40 am
by robin
No! I have much better CPUs for that (Cortex-M3/Cortex-M4).

Cheers,
Robin

Re: Raspberry Pi ...

Posted: Mon Mar 02, 2015 11:40 pm
by BiggestNizzy
Been playing with my pi recently as I thought of a genuine use for it.
I am running the noobs version of the raspbian os and have installed and got apache2, php, SAMBA. And got it all booting to the chromium browser (currently the BBC F1 page) but I have come across a massive problem with my plan. I need to connect it to a mssql database and as far as I can tell I need to setup freeTDS and even though I have installed it but I cant connect. The error log tells me that the php connect string is unknown. Does anyone have any experience with this as the documentation seems to be written for someone with alot more technical knowledge than me.

Re: Raspberry Pi ...

Posted: Tue Mar 03, 2015 12:17 am
by robin
You should be able to install the mysql package directly. Rasbian is a derivative of the debian distribution. It is normal to use the apt-get tool from the command line; assuming you are logging in as a non-privileged user then you need to use the sudo command to raise your privileges temporarily. Alternately, login as root.

sudo apt-get install mysql-server
sudo apt-get install php5-mysql

The former is the actual database engine. The latter is the bindings that allow PHP to access the database - note this is allow as in "provide the code that makes it possible" not "configure the database so that there is a database, there is a user, the user has permissions to access the database, the database is accepting connections from the appropriate source". I have no idea what you're trying to achieve so cannot comment on what's appropriate for the latter. What, actually, are you trying to make work (please tell me it's not WordPress!!!).

If you have the option of using postgresql in place of mysql I suggest you do that (if only because I know postgresql well and so can guide you on what to do).

Re: Raspberry Pi ...

Posted: Tue Mar 03, 2015 9:23 am
by r10crw
Ill send you mine down as it is now languishing in the back of a drawer. Not used it for ages so need to make sure its still working, anyway I need to send you something else thats been sitting here for ages.

Whats your addy again?

Re: Raspberry Pi ...

Posted: Tue Mar 03, 2015 9:52 am
by graeme
Robin,

Using all 6 of mine I'm afraid, but come on, they're like £25 you pikey! :) You'll find a permanent use for it.

Presently:
1 monitoring electricity use in the house using a clamp-type current transformer at the meter (using a custom daemon and rrd tools)
1 grabbing weather data from the USB port on a weather station and storing it for trending/graphing at some point
1 set up as a virtual ADSB radar using a SDR USB dongle (£10 freeview tuner). About 20mile line of sight with the short stick antenna, but I've had a few 300 mile contacts with a tuned length co-linear coaxial antenna.
1 with a GPS receiver connected to GPIO used as a stratum 1 NTP server for the network (work in progress, ms accuracy, but aiming for <20us. totally pointless for NTP I know. )
1 set up as a wireless access point + VPN client which I can carry with me for portable hot-spot. Ideal for hotels with Ethernet in the rooms but poor wifi coverage.
1 monitoring my network monitoring server

I've also at various times dabbled with the usual retro games emulators, most of the media player distros, and had a Pi as my home broadband router/firewall for a while too before I got fiber and needed more throughput.

They're fantastic devices and every kid (of all ages) should have one.

Nizzy,
I think Robin misread MSSQL as MySQL. You don't need to install MySQL to use FreeTDS unless I'm missing something. Echo Robin's request... what's the end goal?

I take it the MS SQL database already exists? If not, use something else. But assuming it does, you want to pull some data out? You'll need to know the server name or IP, what version of SQL server its running, and be on the same network so you can talk to it (sorry if that's a bit obvious) and you'll need authentication details.

Once you've got all that, and FreeTDS installed, you'll need to set up the connection in the freetds.conf (I don't know much about freeTDS but if you get stuck I can read the docs and work it out), then use the connection name you give that the freetds.conf in your PHP like this:

$db_conn = mssql_connect("<yourfreetdsconnectionname>","<user>","<password>") or die("Error: can't connect to db");

I'm guessing from your error message that you've got roughly that far already, so fill in the details or post your configs and we'll go from there.

G

Re: Raspberry Pi ...

Posted: Tue Mar 03, 2015 9:58 am
by tut
Fascinating........

Tried googling on some of the abbreviations but the laptop was getting hot.

tut

Re: Raspberry Pi ...

Posted: Tue Mar 03, 2015 10:04 am
by graeme
A bit more debugging

Can you ping the mssql server?
Can you telnet to it? ("sudo apt-get -y install telnet", then "telnet <server ip> 1433")

in fact, here's a good starter:

http://www.freetds.org/userguide/serverthere.htm

Re: Raspberry Pi ...

Posted: Tue Mar 03, 2015 10:06 am
by robin
Quite right - I saw mysql because that's what a lot of these projects use.

Google suggests this:

http://blog.thesysadmins.co.uk/ubuntu-s ... a-php.html

Note there are two other packages besides the tds - the odbc and sybase packages are required it seems - no idea if that's just random choice or reality (in the back of my head MS SQL server used to be Sybase, so there is some sense to it).

Cheers,
Robin

Re: Raspberry Pi ...

Posted: Tue Mar 03, 2015 10:32 am
by rossybee
A typical day in Graeme's house...

Image

Re: Raspberry Pi ...

Posted: Tue Mar 03, 2015 10:50 am
by graeme
Well the cheese and crackers are correct, and it's not very tidy, and I do wear the wrong trousers on occasions, so there are some similarities.

However, Wallace is clearly having a spot of trouble with his porridge cannon, while mine is fully operational.

Re: Raspberry Pi ...

Posted: Tue Mar 03, 2015 11:23 am
by rossybee
graeme wrote:, Wallace is clearly having a spot of trouble with his porridge cannon, while mine is fully operational.
Fnarrr!

Re: Raspberry Pi ...

Posted: Tue Mar 03, 2015 11:51 am
by campbell
Graeme you need to have more children. First to ensure you don't have time to tool around with Raspberry PIs and second to keep your porridge cannon in full working order.

;-)

Re: Raspberry Pi ...

Posted: Tue Mar 03, 2015 12:25 pm
by rossybee
Maybe he's like me....porridge cannon decommissioned...but still functioning purely for recreational purposes?