I'm currently working on a Modbus TCP JAVA project using the jamod library. So far, I'm able to read & write to the Modbus network (gateway & some sensors from 4-noks) without any issues. My next step is to receive the data of the sensors automatically.
The devices I'm using are sending their registers to the Modbus-Gateway at regular intervals (about 20-60seconds). Unfortunately, I'm having some problems in receiving these data.
The Gateway has a register in which it's counting the received messages and it does receive data of the sensors, but how can I display these data onto my PC using java (jamod, or maybe another library)?
I have been searching and trying for the last week and I'm out of ideas. Would be very nice to get some information on how this goal can be achieved!
It depends how you want to display the data and what your intentions are.
On the full-solution end of the spectrum this is what an HMI/SCADA system does for you (www.inductiveautomation.com, for example).
On the roll-it-yourself end of the spectrum it sounds like you just need to continually poll the gateway for the registers you're interested in and maybe display it on a webpage.
Where do you land on this spectrum?
Related
I'm using Kurento (more specifically, this example) to create a P2P app on Android.
I intend to deliver large files with this app. Problem is, with this example, a separate datachannel is opened for every peer connected to the "host". This would be simply unusable - incompatible with the average user's upload speed.
So, I want to create a topology sort of like common torrent P2P apps - every peer connected contributes their upload speed to the peer group.
How can I implement this?
Thanks a ton in advance!
I have a plan of automating a process via REST api and multiple smart devices. What I am trying to do is the following. I have 4 devices that each do a series of actions to complete their task. (practicaly Im gonna be lighting 4 leds in a particular series based on the device). Im currently emulating this in Java (since I dont have the devices at hand)
So for example lets say device no.1 lights up the red led first for 10 seconds, after that device no.2 needs to light up for 10 seconds etc. That's the task. This is done automatically and forever till I shutdown the program.
I have developed a REST API using JAVA and the JAX-RS library where I state the devices and their info (so device name, current state ex. Yellow Led ON/OFF etc.).
What I dont understand is how I am gonna make the program I have now respond to the info from the API. How can I make my program get notified when a value is changed on the API info?
How can I make device 2 poll the API till it gets the response to start its action? Or make it so it starts the action if i manually change the value on the server data? Example if the yellow led is on, and i go in the server database and put it on off, how will my application get notified and change the state of the simulated led?
Since you are using HTTP, most suitable solution is to use web sockets. You can use them for full duplex communication. When you receive input from one device, you can process it and inform other devices. Note that this is not suitable for a large client base.
I'm trying to create an android controller app that will send seekbar data for a steering wheel, brakes, and throttle to the raspberry pi. I've been using TCP/IP over ethernet to communicate with the pi, but I need a way to identify the different data streams associated with the seekbars. I've looked into JeroMQ, and Java Object Serialization but would like to get some suggestions. Ultimately, I need to send, and receive data to/from the Pi, essentially, the data needs to be synced, so that if, let's say, the steering wheel moves in the Pi program, the android also receives that data, and vice versa. Thanks Wizards.
The solution is to use a framework like MQTT or JeroMQ(ZeroMQ) to send the messages, either one will allow you to publish and subscribe, so you don't have to worry about creating a parser, this works particularly well when you need data being communicated bilaterally.
JeroMQ
MQTT
I'm working on creating an Android app that will act as a controller for a robot I'm building for my kids. I just want to be able to turn it's head, and move it's arms. I was experimenting with TCP/IP earlier, and was able to send data from my phone to my Raspi. The issue I'm confused about is how to go about parsing the data. Currently, I'm just dumping all of the data into one stream from the phone, is there any way to send data for the head turn, and the individual arms as separate streams, and then send them off to the robot?
Why don't you use any popular format like JSON or XML for this like
{"command":{"type":"head","direction":{"up":"2","down":"0","left":"0","right":"0"}}}
And parse it in the RPi
I would like to develop a application that when used between two phone we can send exchange data(like e-visiting card). I intend to develop it for all smart phones even those without NFC. I am just a budding developer and would like to have some references about the possibilities of such an app. i have seen BUMP but i do not intend to maintain any server and would like to create a temporary network between the two phones and terminate it after the transfer. So is there any possibility in developing such an app?
Thanks in advance
Depends on the size of the data, but one possibility that comes to mind is the use of QR codes.
http://en.wikipedia.org/wiki/QR_code
You could try using a library like zxing (https://code.google.com/p/zxing/) to generate the qr codes.
Basically the phone wanting to send the data generates a qr code representation than the phone wanting to read the data reads the qr code with its camera and translates back to the original data.
I think you should try to use bluetoolth or local area network.
I pefer LAN.
In your app , you can set one app as server, another app as client.
make a socket connection and send your data.