User avatar
liudr
Posts: 687
Joined: Sat Jun 01, 2013 12:11 am
Location: Central MN, USA
Contact: Website

Where to start with c/c++, sensor logging and network apps?

Wed Jun 05, 2013 5:02 am

Hi community! I ordered my pi just last weekend, after a long period of thinking "what would I do with such thing?"

From a pure programming aspect, I am not new to it. I have done projects in the past that would amount as many an 10K-20K lines of code per project, both using Arduino (C/C++) and Processing (Java). I also have some reasonable knowledge in client side JavaScript, HTML, and HTTP. But programming on pi makes me nervous. I don't know linux and I don't know where to start. I have a reasonable goal:

I want to use the pi to log sensor readings, control actuators, and to be able to send data to an internet server periodically and provide a web-based GUI with the pi so users may change parameters of the logger. I have reached this goal with Arduino but Arduino has very limited memory, crude debugging, and its wifi hardware is far from stable so I wanted to migrate the project to pi.

I think I need to learn the following:

How to talk with Arduino via serial port to read sensors and control actuators (I can take care of the Arduino side)
How to establish a TCP connection with remote server and post data to remove server
How to listen to certain TCP ports and provide service to clients (web-based GUI)

Please kindly provide some information such as sample code, online or book readings. Thank you! :geek:
Arduino data loggers, user interface, printed circuit board designer since 2009, RPI 3B 2B 2B Zero Jessie, assembly/C/C++/java/python programmer since the 80's

vputnik
Posts: 4
Joined: Tue Apr 16, 2013 4:56 am

Re: Where to start with c/c++, sensor logging and network ap

Thu Jun 06, 2013 12:56 pm

Hey,

I'm also currently in programming the RPI.
My aim is also to run a Java Servlet Container (Jetty+Spring MVC) on the Pi. My actual situation:

- installing JVM + MySQL on the RPI
- developing a basic spring mvc application with CRUD-Operations towards the mysql-db
- using an expansion board with temperature sensor to insert such informations into the db and displaying it with the application in my website

what's your aim? also using servlets?
now my aim is to include an EnOcean Transceiver....

greetz

User avatar
liudr
Posts: 687
Joined: Sat Jun 01, 2013 12:11 am
Location: Central MN, USA
Contact: Website

Re: Where to start with c/c++, sensor logging and network ap

Thu Jun 06, 2013 5:16 pm

vputnik,

My goal is similar to yours except that I want to write my own internet applications, i.e., handling TCP requests programmatically and not relying on any server applications. I am going to use Arduino to talk to sensors. What is your plan on the sensor side, directly talking to them with pi or using a microcontroller?
Arduino data loggers, user interface, printed circuit board designer since 2009, RPI 3B 2B 2B Zero Jessie, assembly/C/C++/java/python programmer since the 80's

User avatar
liudr
Posts: 687
Joined: Sat Jun 01, 2013 12:11 am
Location: Central MN, USA
Contact: Website

Re: Where to start with c/c++, sensor logging and network ap

Thu Jun 06, 2013 5:17 pm

So after a day with the pi, I was able to understand basic commands of Linux and a bit about pi. I think right now my focus will be making Arduino work on a Linux PC and migrate code to pi after they are tested. Trying to compile largish code on pi will probably take too much time.
Arduino data loggers, user interface, printed circuit board designer since 2009, RPI 3B 2B 2B Zero Jessie, assembly/C/C++/java/python programmer since the 80's

Return to “General programming discussion”