0

First of all, I have nearly zero experience with HTML and java, so a simple answer will be appreciated!

I'm working on a WSN project using a telosb mote running TinyOS and Xubuntu, what I have to do is set up a web server that can communicate with my mote, and the only way I know of doing this is with command lines, using "java net.tinyos.tools.Send X" where X is my input from my web server.

So on my web server, have a form where i can input a number to send to my mote, and when submitting the number a function runs the command java net.tinyos.tools.Send X.

Is this possible?

I have read previous answered questions but please note that I know nothing about java as I work with electronics, so I pray for answers that a beginner like me will understand. Thank you very much!

spacegoing
  • 5,056
  • 5
  • 25
  • 42
akher
  • 1
  • First important thing to not java is to javascript as ham is to hamster. Apart from characters shared in the name, there is no relationship. Next is what exactly are you using for a webserver, that will determine what you need to do. It is hard for us to give you easy to follow specific answers to a question that is quite broad. – Jon P Jan 17 '20 at 05:35

1 Answers1

0

Yes you can run system commands using a web server. Simply send the value from browser to your server. And when the server receives the value you can execute the desired system command.

For example, If your server is in python (e.g. Flask), look for os.system in python os module. https://docs.python.org/3/library/os.html

if your server is in nodejs (e.g. Express) look for child_process.exec in child_process module to run system commands. https://nodejs.org/api/child_process.html

Casper
  • 11
  • 2