LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-14-2011, 04:26 AM   #106
kalleanka
Member
 
Registered: Aug 2003
Location: Mallorca, Spain
Distribution: xubuntu
Posts: 551

Rep: Reputation: 38

Hi,

- you do not need a RTOS. Any linux would work fine. If you want a small OS only for your system then I would use DSL or tinycore.

- I would use LAMP for the presentation of the data and use any browser as client(this will save you a lot of problems). To collect the data I would have a demon runnig and feeding the database. The database would become your intercommunication tool. LAMP is not so hard to set up. To do the web pages in PHP is also not to hard but sql might be. To write the demon is a harder job if its done in c for example. Maybe Perl is a easier and better choice.

- You could make the hole system run on windows, mac, linux etc.

- so you need to learn
sql, html, php, c or perl and ofcourse programs like mysql, apache, linux etc.

As suggested maybe its better to pay for the help doing these parts and you can devote your time on marketing, selling etc.

Good luck and we are here to help.


and if you do not like eclipse try netbeans with git or subversion.


and you could make the hole system as a blackbox running a small webserver and the demon under linux. You would connect it the the localnetwork (ethernet) and connect all the watteringunits to the serial port or usb via a converter. Like a router!

Last edited by kalleanka; 11-14-2011 at 08:04 AM.
 
1 members found this post helpful.
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 11-18-2011, 11:11 AM   #107
schmitta
Member
 
Registered: May 2011
Location: Blacksburg VA
Distribution: UBUNTU, LXLE
Posts: 352

Original Poster
Rep: Reputation: Disabled
Kalleanka may be correct. Running as a browser only the daemon would have to change for windows, mac and linux. The browser would already be there for the system and apache and MySQL exist for all three platforms. This would be especially true for HTML5. HTML5 works on smartphones and now in automobiles plus it would work for all browsers seamlessly. I guess I could limit parameter changing to the host machine or maybe live dangerously and let the user change parameters anywhere in the world. Java would then only be needed for javascript in the html.
 
Old 11-18-2011, 11:21 AM   #108
schmitta
Member
 
Registered: May 2011
Location: Blacksburg VA
Distribution: UBUNTU, LXLE
Posts: 352

Original Poster
Rep: Reputation: Disabled
Why would the daemon be easier with perl than with C?
 
Old 11-19-2011, 07:01 AM   #109
Proud
Senior Member
 
Registered: Dec 2002
Location: England
Distribution: Used to use Mandrake/Mandriva
Posts: 2,794

Rep: Reputation: 116Reputation: 116
Java is nothing to do with Javascript.

Perl is interpreted, you can write the script once and it'll work where there's a perl interpreter installed, whereas a C program needs to be recompiled for each OS (Windows, Linux, etc) and machine architecture (x86, ARM, etc).

This relates to why people like Java, it's compiled but to a intermediate level where it'll still run anywhere there's a JRE.
Javascript is interpreted, like Perl, so you don't need to worry about if the browser's on a phone (ARM), PC (x86), or other.
 
Old 11-19-2011, 11:44 PM   #110
schmitta
Member
 
Registered: May 2011
Location: Blacksburg VA
Distribution: UBUNTU, LXLE
Posts: 352

Original Poster
Rep: Reputation: Disabled
To Proud -- Things are look as if I will have two approaches 1) for large systems I will have a PC running linux that will communicate with the RS485 system via a daemon and and two the outside with apache. I am wondering if I can make it an ISP and make it connect directly to the internet. For the other 2) I think the device can exist standalone without a PC. This would be for small applications of only stand alone mist sensors. If the user wants to change parameters in the mist sensor he can buy a small linux PC from me to do so. It would not be cheap but not very expensive either. I would not use the users PC running windows or mac to do the connection. They would have to buy the linux pc from me. Alvin...
 
Old 12-05-2011, 06:26 AM   #111
schmitta
Member
 
Registered: May 2011
Location: Blacksburg VA
Distribution: UBUNTU, LXLE
Posts: 352

Original Poster
Rep: Reputation: Disabled
Can I have a java daemon (or service on windows)) that runs all the time on its own with no user (main?) programs running like you could with C?

Last edited by schmitta; 12-05-2011 at 06:28 AM.
 
Old 12-05-2011, 07:32 AM   #112
Proud
Senior Member
 
Registered: Dec 2002
Location: England
Distribution: Used to use Mandrake/Mandriva
Posts: 2,794

Rep: Reputation: 116Reputation: 116
AFAIK you can have a Java program/service running without a GUI or specific desktop user logged in, yes. It would still be technically run under a specific user account, but that's like any service and just how OSs work unless you move the process into the kernel.
 
1 members found this post helpful.
Old 12-05-2011, 07:43 AM   #113
schmitta
Member
 
Registered: May 2011
Location: Blacksburg VA
Distribution: UBUNTU, LXLE
Posts: 352

Original Poster
Rep: Reputation: Disabled
How would one launch something like a java daemon?
 
Old 12-05-2011, 07:49 AM   #114
Proud
Senior Member
 
Registered: Dec 2002
Location: England
Distribution: Used to use Mandrake/Mandriva
Posts: 2,794

Rep: Reputation: 116Reputation: 116
The same way you'd launch any other service or daemon? Using the OS's startup scripts. For Linux I believe that's the init or systemd mechanism. Windows has the Service Control Manager. There seem to be a variety of wrappers available, such as http://commons.apache.org/daemon/jsvc.html
 
Old 12-05-2011, 09:51 AM   #115
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
A daemon is a process which has detached itself from its initial controlling terminal. I'm not sure if/how that can be accomplished in Java. It isn't strictly necessary to daemonize all services, and depending on the application, it might be undesirable if, for instance, there is an interactive component to it. There is a fairly well defined structure for starting, stopping, querying, and restarting services in Linux. Sometimes, it is as simple as adding a line or two to /etc/rc.local


--- rod.
 
Old 12-27-2011, 01:54 AM   #116
schmitta
Member
 
Registered: May 2011
Location: Blacksburg VA
Distribution: UBUNTU, LXLE
Posts: 352

Original Poster
Rep: Reputation: Disabled
Python

Supposedly Python is interpreted on Linux, Windows and the Mac. Would that be an alternative to Java to be cross platform and could I do a daemon with Python? Thanks. Alvin....
 
Old 12-27-2011, 11:56 AM   #117
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
You can use the python-daemon 1.5.5 to daemonize Python programs. Yes, Python would be a cross platform alternative to Java, in my opinion. If it was my project, I think I would probably chose it over Java for non-GUI applications. Possibly even for GUI applications.

--- rod.
 
1 members found this post helpful.
Old 12-27-2011, 01:31 PM   #118
schmitta
Member
 
Registered: May 2011
Location: Blacksburg VA
Distribution: UBUNTU, LXLE
Posts: 352

Original Poster
Rep: Reputation: Disabled
I am using the Python book "Python Programming and GUIs for Electronic Engineers" ( http://www.elektor.com/products/book....1320886.lynkx ) which is great for me - Also goes over apache, html needed and server side Python code. Thanks for you input on what you would do if you were building the project. Alvin...
 
Old 01-02-2012, 02:04 PM   #119
P_Titty
LQ Newbie
 
Registered: Dec 2010
Posts: 3

Rep: Reputation: 0
I have a question for aspire1 or any one else.

Even though its not directly related to this thread...


Quote:
Originally Posted by aspire1 View Post
For what it's worth and it may not be relevant to what you're doing...anyway.

I recently had to devise a way of connecting an Arduino connected via usb/serial to network. I used a java program accessing the serial port. I delegated
responsibility for syncing read/writes and providing data to the arduino. Arduino sent a handshake to the java program when it wanted to send data
and Arduino sent a handshake to the java program when it was available to receive data. I cached the data sent from the Arduino in the java program
using a map so any clients that connected didn't have to directly read from the Arduino. The Arduino would constantly update the data in the java program
map.

Clients connected via sockets to the java program. I used apache and Php to pass through client connections ( inefficient under lots of connections
but it meant I could use Apaches security features). No reason why browsers couldn't connect directly to the java program though.
The requests to write would be forwarded to the java program which would queue them and send them down the usb/serial to the Arduino.

The model may be of use or not.
My home automation project to involves Micro Controllers talking over RS485 and tied to an Ubuntu Server.
Ive developed a Java GUI with the Swing library and is deployed as a Java Application - not an applet.
My problem, How can I remotely access the Java application which is running on the server since the GUI is not a web-app/html?


As described below?

Quote:
Originally Posted by aspire1 View Post
I used apache and Php to pass through client connections ( inefficient under lots of connections
but it meant I could use Apaches security features). No reason why browsers couldn't connect directly to the java program though.
If I need to start a new thread please let me know.
thanks for any help in advance!

Last edited by P_Titty; 01-02-2012 at 02:09 PM.
 
Old 01-02-2012, 06:19 PM   #120
schmitta
Member
 
Registered: May 2011
Location: Blacksburg VA
Distribution: UBUNTU, LXLE
Posts: 352

Original Poster
Rep: Reputation: Disabled
I have not gotten that far yet. But PHP would probably be the way to go.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Enterprise LAMP Summit & Big LAMP Camp LXer Syndicated Linux News 0 09-21-2009 01:51 AM
LXer: LAMP vs. LAMP Rematch LXer Syndicated Linux News 0 11-08-2006 03:03 AM
A program for FC4 to communicate with a Windows Hyperterminal Program at other end vhasun Linux - Software 2 05-19-2006 02:54 PM
My C Chat Program is unable to communicate. mcp_achindra Programming 1 03-20-2004 10:04 AM
program to communicate directly with ethernet sabby Programming 4 12-18-2002 11:37 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration