MQTT with EHS6 | Telit Cinterion IoT Developer Community
December 9, 2019 - 11:03am, 3147 views
I had go through this demo successfully with the jad file from this tuto https://iot-developer.thalesgroup.com/showcase/paho-project-110-july-2016-mqtt-311 on my EHS6 REVISION 03.00. I encounter a problem when I try to modify the java file. I'm not an eclipse user and confused about how to compile the MIDlet file in order to transfer to my modem. Does there any step-by-step to import paho and run the jad file based on this?
Thanks in advance.
Here you can find the Java User's Guide docuemnt which explains step by stem how to install the enironment, crate project etc.
When you're adding a jar library to the project it is important to mark it for export in Project Properties / Java Build Path / Order and Export. Otherwise the libraries will not be added to the MIDlet and it will not work.
I did that but can't install the jar file via MES. I think the problem happened during the import file of paho java client. Can u be more specific on the steps of how to use the paho in eclipse? Ps: I have imported paho.mqtt.java-master file inside my directory.
Please describe what exactly is the problem with installation? Is there any error while you install the MIDlet with an AT command? Please send AT+CMEE=2 before the installation - maybe there will be more information. If this happens the MIDlet is probably not built correctly.
If for any reason the lib wasn't exported to the MIDlet suite the MIDlet would install anyway and you'd see some exceptions after starting it. You can unzip the jar file and see if there are all the class files that you need.
BTW under the article I can see the demo MIDlet that you can install and run and the source files. So if there are source files you only need to copy the files to your project and there's no need to export anything. You only need to export jar files if you are using any external library in a form of jar.
My CME Error : Unknown. I suspect my midlet didn't build correctly bcauz I can successful run HelloWorld.jad. So, I suspect my steps to import the paho file is wrong and the building too since I can compile and run the simple HelloWorld file without any import.
'Error : Unknown' is not very helpful. But still if you get it on the installation attempt there must be something wrong with the build or MIDlet configuration. Please make sure that you have followed the Java User's Guide in new project creation and configuration. Please open Application descriptor and compare with the working project. You could also copy the paho files to an exisitng working project for test. Please check if there are no compilation errors, all the paths are correct etc.
First, I created a maven project to get a POM and then move the github eclipse paho under main file. After, I created a midlet. Is my approach correct? I believe I had confused about the build path.
The github link points to the original paho Java SE project. For this article Simon has ported the project to Java ME and the files are available as download package under the article. You need to use these files or port on your own. Then please create MIDlet project and copy the files there. At least for test or proof of concept please follow the Java User's guide way. Then if you have the working project you can add maven.
You probably need a Java training course. Then to attend one of our Java ME embedded courses.
See this getting started article for Eclipse: https://iot-developer.thalesgroup.com/tutorial/starting-out-java-me-volc...
Or this getting started article for Netbeans: https://iot-developer.thalesgroup.com/tutorial/starting-out-java-me-volc...