for a school project I recently bought an Orange Pi +2 hoping to use it to control a few electronics with the GPIO pins. I have many years of Java experience so I naturally wanted to write my code in that language. When trying to install pi4j which is a java library for raspberry pi I get this error:
mackenzie#OrangePI:~$ sudo java -jar LCD.jar
sudo: unable to resolve host OrangePI
Unable to determine hardware version. I see: Hardware : sun8i,
- expecting BCM2708 or BCM2709. Please report this to projects#drogon.net
I was wondering if anyone had any ports for the Orange Pi and if not I will have to write my program in C. I am running Debian 8 jacer 2 as the os.
Experimental support for OrangePi is now included in the latest Pi4J v1.2-SNAPSHOT builds. Please be aware that this is largely untested at this time. Feel free to try it out and report issues to the project.
I'm afraid that the WiringPi port for OrangePi (WiringOP) may be slightly outdated and may not support the newer/latest OrangePi hardware models, but more testing is needed to confirm which models are working.
I saw this post that may help you : https://groups.google.com/forum/#!topic/pi4j/T30EUL2Z10I
As I do not own this device, so I cannot verify by myself.
For Raspberry Pi there is the well-known wiringPi library, written in C, for GPIO access and control. This library has been ported for the Orange Pi. The port is called wiringPO. I wrote a simple Java class with a native method. The native method gives me access to the wiringPO library, and I use JNI to allow my java application to interact with the native method. Works like a charm.
Add the line:
GpioFactory.setDefaultProvider(new OrangePiGpioProvider());
before getting instance: gpio = GpioFactory.getInstance();
the problem is with every orange pi, the problem is with resolv.conf in /etc/resolv.conf.
do
sudo nano /../etc/resolv.conf
and then add
nameserver 8.8.8.8
to it
and control-o to save it
Related
I have a Vex ARM Cortex-based Microcontroller and a Raspberry Pi B model, so I had the idea of having the Microcontroller send information through the UART Ports to the Pi. I have everything working on the Microcontroller's end since can easily test that it reads and writes to itself, but my trouble comes in when I try to program the Pi. I am using Java to write the program and I am also using the Java rxtx library. After I got a simple program that would test the ability to send and receive things I tried to run it and got the UnsatisfiedLinkErorr: no rxtxSerial in Java.library.pathwhich I fixed by going in and editing the native library location to the one for mac, as I am writing this on a mac. I then run it on my mac and it gets to the point of it seeing that the tty that I gave it was used or something along those lines, which is good since that means everything ran correctly. However, when I go to Pi it does not work and I get the same error UnsatisfiedLinkErorr: no rxtxSerial in Java.library.path, so I think that it is the native library location not being for linux, but I do not know which machine type I should use since there are three to choose from, if that is even the problem.
Objective : I want the java project to connect to a mobile(android) hotspot.
I referred to WIFI - Scan and Connect using Java and tried using jwlanSacn lib but unfortunately it works only for 32 bit systems. This lib uses JNI.
Is there a way to connect to a mobile hotspot in java? Any libraries ?
or can I create my own JNI code for it?
Also, referred to
WIFI - Scan and Connect using Java
Finding SSID of a wireless network with Java
I'm working on 64bit Windows.
I'm new in pure java programming. Please help!
Thanks
You have to do it from the command line. You pretty much have to execute OS-specific instructions from your java program to command line using Runtime.getRuntime().exec(...) And then do some kind of parsing for the response you get. That's the idea.
Sorry I can't help more right now. I will update my answer as soon as I investigate this further
I'm building a simple gui in Java that has three selections which I'm going to place on the RPI. Depending on the selection, I need the RPI to output differing signals to a separate microcontroller that will
determine the operation of a larger mechanical system.
I can't seem to find anywhere that explains how to get a Java program to send output signals from an RPI based on user selection. Any and all assistance and guidance would be much appreciated.
Java code is run on a virtual machine which in itself will have no interface for controlling Raspberry Pi GP I/O pins. You will have to use a separate Raspberry Pi -specific native library, which you might be able to access through the Java Native Interface. Luckily the work seems to have been done for you, as a Java library like this exists.
Greetings,
I need to port this Windows utility: http://solinker.com to Mac.
The app was written in C#, .NET 2.0.
The main requirement is:
The app should be able to talk with AppleScript to interact with Photoshop. The program is small and UI is simple so I could consider to fully rewritte the app.
Possible candidates are:
MonoMac
Unity 3D (seems it doesn't required to install the Mono)
XULRunner (Flickr Uploader written by XULR)
QT
Java (convert all the app to Java + 2 different connector to photoshop:
for Mac and for Win)
I would be appreciate for any advice!
I'm not experienced with others but can definitely suggest MonoMac. It looks and feels like any other Mac app while running on Mac. On the other hand, if the application was written with Visual Studio on Windows, it never properly works on MonoMac. So prefer MonoDevelop, if you go this route.
If you check the documentation for MonoMac, you will see they have a packager which bundles all dependencies with the final app. So, no need for a seperate Mono install:
http://www.mono-project.com/MonoMacPackager
As for AppleScript, MonoDevelop does some wrapping of AppleScript. You should take a look at their source:
https://github.com/mono/monodevelop/blob/master/main/src/addins/MacPlatform/MacInterop/AppleScript.cs
I would say MonoMac is your best approach.
Looking for a way to read the unique ID / serial# of a USB thumb drive;
please note that
- I am looking for the value of the manufacturer, not the one Windows allocates for it.
- I need to support multiple OS (Windows, Unix, Mac), thus needs to be a Java solution
The idea is to be able to distinguish between different USB thumb drives.
RXTX is the way to go. In the world of model trains, JMRI (Java Model Railroad Interface) has become very popular. JMRI runs on all platforms (Windows, Linux and Mac) and communicates with a variety of USB based devices (command stations). RXTX is in fact used by JMRI.
You might give a look at the following projects:
javax-usb and jusb. They seem to support Linux and Windows.
Anyway, since USB access in Java requires the use of native libraries, you might not achieve the required portability.
I've never tried using it (it's been on my todo list for a good few months now), but there is the "marge" project on java.net:
http://marge.java.net/
This should let you connect to bluetooth devices (although I don't think it is 100% feature complete, there is demo code on there), and then the ClientDevice class has a "getBluetoothAddress" method which I believe should be unique to that device
http://marge.java.net/javadoc/v06/marge-core/net/java/dev/marge/entity/ClientDevice.html
As I say though, I've never tried it...
I have never investigated this thoroughly, but from memory the RXTX library implementation of the javax.comm packages are supposedly very good and now have USB support.