Order of JAVA ME on Raspberry PI software servo with/dev/servoblaster

Long post:
I use JAVA ME on Raspberry PI to drive the different engines and a robot sensors, everything works fine, but also wanted to do servos from the software. Apparently I can't do it directly by the control of length of puls of software on an operating system such as Raspberry PI, too vague. So, I tried to switch to the use of servoblaster that uses the DMA access to control the pulse duration. It works fine when it is called from python or command line, but now, I want to call from JAVA ME program.
For this I need to write some simple arrangements to/dev/servoblaster.
After start, l - ls/dev/servoblaster shows:
PRW-rw-rw-1 root root 0 Feb 8 16:55 / dev/servoblaster
I tried to use the following code, with a few expressions of feeling between the two, to open the servoblaster that I can then send values to him to drive the servos:

ServoPath path = FileSystems.getDefault().getPath("/dev","servoblaster");
System.out.println ("set path" + servoPath.toString ());
outStream = Files.newOutputStream (servoPath, WRITE);
System.out.println ("created outstream");

Also, I tried another method in JAVA ME 8 with the following code. The two options are the MOOC on JAVA ME course.
connection = (FileConnection)
Connector.Open ("file:///rootfs/dev/servoblaster", Connector.WRITE);
System.out.println ("connection opened");
fileWriter = new PrintStream (connection.openOutputStream ());
System.out.println ("filewriter started");

In both cases, the statements will fail on the line 3rd , that is the opening of the OutputStream. I get an error on the invoice, pro forma raspberry:

[CRITICAL] [SECURITY] iso = 2:Permission check failed: java.io.FilePermission "/ dev/servoblaster" "write".
TRACK: java.security.AccessControlException: >, lanceApp generated an Exception
Although I defined the following permissions
java.io.FilePermission "/ *" 'write '.
and
javax.microedition.io.Connector.file.write
javax.microedition.io.Connector.file.read

So far, my conclusion is that fails because JAVA ME8 does not support a PipedOutputStream
My other option would be to escape from the command line, make echo/dev/servoblaster settings and then return to the JAVA ME program
but I found that JAVA ME also does not support the runtime exec command so I can't do that.

So my only option now seems to be to move to JAVA SE. I tried servoblaster of JAVA SE and that works very well, I just open it and send data to it, servo reacts, no problem. But then, I still need to control other motors and sensors.

I then tried install libraries open jdk.dio on the IP, so I can still use what I've done so far, but the installation instructions are not clear to me, and do not work.

So now I'm moving away from JAVA ME and move to JAVA SE with PI4J, unless someone here can help me out.

Thank you
Willem

Hi Willem.

That's right, JavaME can open only normal files (link, pipes, blocks, char, FIFO, and socket is not supported).

/ Sergey

Tags: Java

Similar Questions

Maybe you are looking for

  • Mac Mini and magnets

    Could place a magnetized on a mac mini and get her to completely clean the computer?

  • Mozilla Firefox creates Internet Explorer + adware files?

    I use Firefox for some time now, but just can't quite understand why/how it is: When im cleaning my files using CCleaner, I sometimes have an extreme amount of folders of IE, as 300-500 MB of a value (note I use Ccleaner several times a day which is

  • Portege R700-184 freezes + high speed fan

    Hi all I am a happy owner of a unused R700, bought in conditions under renovation.But as far as I can see, it has not been used since around 2011, and judging by the box was stored in a warehouse and was used. I installed Windows 7 64 bit I need to u

  • Update BIOS

    I've recently updated my BIOS on my laptop and it has changed some of the controls as I have to hold the Fn to set the volume and the brightness up and down. When I press the brightness button without holding the Fn, he acts as the arrows at the top

  • Windows pro SP2

    I have a gx280 with xp pro which had not been used since 2005 need service Pack2 or do I need to get on the internet.what can I do.