cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Problems with the Enhanced ThingWorx Android App

gkiouplidis
1-Newbie

Problems with the Enhanced ThingWorx Android App

Hello everybody

I'm trying to get this example project running and I've come to a point where I'm stuck. Maybe you can help me fix my problem.

The app doesn't seem to send anything to my Thingworx-Instance. So far, I've followed the example, which can be found on Enhanced ThingWorx Android App | ThingWorx. I've also tried using two different devices without any further success. Here are some screenshots. I'd appreciate any help you can give me.

Screenshot_2016-03-06-21-03-07.pngScreenshot_2016-03-06-20-50-20.pngScreenshot_2016-03-06-20-50-27.png

1.png2.png

24 REPLIES 24

Georgios, is this a locally hosted instance or are you trying to connect to a cloud server? The server you've pinged doesn't seem to be responsive.

Hello Aanjan

First of all thank you for you answer. The instance is a cloud server. It appears to be normal, that the server isn't responsive when pinged as the following 2 pictures from the Tutorial PDF: Enhanced-ThingWorx-Android-App-Introduction.pdf show from Enhanced ThingWorx Android App | ThingWorx.

Unbenanntes Bild.pngUnbenanntes Bild2.png

Another thing I forgot to mention is, that I've also tried the following Port Numbers:

- 80

- 8080

- 8000

Georgios, can you try hitting port 443? I was able to access your server at that port.

Hello Aanjan

How did you access the server?

Unfortunately, the port 443 doesn't work as well. In addition, the message "Connection error, check IP, Thing Name or App Key" appears.

Screenshot_2016-03-08-16-07-56.pngScreenshot_2016-03-08-16-08-03.png

By access, I meant I could connect to your server with https://52.23.107.38:443/Thingworx. I couldn't connect via http (maybe it is hosted on a port other than 80 or 8080, or it might not be enabled). Going by the error message, can you make sure a Thing with the specific name exists on the server and a valid appKey is in place?

Ok thanks, Aanjan. Judging by this, the port has to be 443, since I'm able to connect through https://52.23.107.38:443/Thingworx and the link we got from PTC is an https too.

I've checked the appKey. According to the Mashup it should be:

702fa820-093d-4a56-a46e-5b848b4cdab2

and after copy pasting from my device and sending via email, I've received

702fa820-093d-4a56-a46e-5b848b4cdab2

so this is also correct.

The same goes for the IP address.

The device was added as instructed on the page. Here are some pictures:

Unbenanntes Bild.pngUnbenanntes Bild2.png

Great, thanks for checking! Now if you open that 'EnhancedAndroidDevice....' Thing with your mobile app connected, under the properties section, is the isConnected property set to true or false?

Hello Aanjan. I went to that page, but there is no "isConnected" property under this section.

Unbenanntes Bild.png

If it is a Remote Thing (it should be, since we are connecting to it), the isConnected property should be under the 'Connectable' section.

isConnected.JPG

Unfortunately, there is no Connection tab with a property isConnected, only the ones shown in the screenshot the post before. Here is another screenshot with some more space of the display.

Unbenanntes Bild.png

It doesn't look like they are locally bound to a remote thing either. It seems to me that's the problem here. When you connect your mobile app, please go to Monitoring -> Remote Things. Do you see any connected Things? Is there anything (no pun intended) in the Unbound tab?

I've taken a look and there is nothing displayed in any from this tabs.

Unbenanntes Bild.pngUnbenanntes Bild2.png

These two screens were taken after you connected your mobile phone, right? It looks like the connection never happened. Can you go into Monitoring -> Communication and see if there are any log messages? Please do modify the Date/Time if needed.

Yes, that's right. Although I don't think that makes a difference, since the mobile App either responses: "Connection error, check IP, Thing Name or App Key" when using the Port 443, or no response at all, when using the port 80,8000 or 8080. There is never a response "Sending data to TWX successfully" as seen on page 15 in the instructional *.pdf.

Following now are two screenshots of the monitors. Noticeably, there is no entry with the date 2016-03-11, as there should be. I've tried to connect with my device using the ports, 443, 80,8000,8080.

Unbenanntes Bild.pngUnbenanntes Bild2.png

If this was a local server, I would have suggested checking firewall inbound/ outbound settings, but since this is a cloud server, we can skip that part.

With the appKey you posted (and with the server ip), I was able to connect an Edge Microserver to your cloud server from my end, so I don't think there's an issue, connectivity-wise. Are you on a wifi network when you try this through your phone? Can you switch to your network provider and retry?

On a side note, sorry that it's taking this long for you to connect and get it working; this is usually a fairly straightforward and easy process.

No Problem. Most likely we'll figure it out at some point.

I've tried so far only with the WiF connection. But trying with WiFi disabled has changed nothing so far, on both tested devices.

Now I've shared the tutorial with my colleague who will also try to get it running on his device. Because at the moment, I was the only person trying it on my own with two different devices. Maybe the factor human is the problem here.

Another thing I've tried now is to get it running with a Windows Phone according to Getting Started with Windows Smartphones and ThingWorx | ThingWorx. But sadly, this doesn't work either. When sending Data first the App responses with "Sending data to TWX successfully. After a while, the "could not connect to..." message appears. The communication log under monitoring still remains the same empty as before.

Hi Georgios,

I belige you are using a ThingWorx version 6.6 , please follow these steps to enable REST calls because they are not allowed by default starting from TWX 6.0

1.       Click on Subsystems under SYSTEM within the left pane of Composer

2.            Click on PlatformSubsystem

3.            Click on Configuration

4.            Check the box next to Allow Request Method Switch to allow all REST API calls through a browser URL

5.            Uncheck Filter Content-Type

Please let me know if this fixed the problem.

Thank you,

Veronica

Hello Veronica

Thank you for your answer aswell. The Version seems to be 6.6 as the picture shows.

Capture2.PNG

I changed and saved the parameters as you told me, but unfortunately, the app still writes: No data is currently sent to TWX.

Capture.PNG

Hi Georgios,

Sorry for the late reply. I was on a business trip. I am afraid the app is not currently properly configured to work with secure instances. I will have to look over it and come back to you with a modified version. If you have java programming knowledge, you might be able to modify it yourself. Here is a link that addresses REST calls in java over SSL. The source code of the Android Studio project can be downloaded from the thingworx.com website.

I might be able to modify the project myself and have it updated on the project website by the end of the week. In case it will take me longer to do this, as a workaround, you can also use your automatically generate ThingWorx instance from the developer zone  

Because that instance is not over https. You would still need to modify the PlatformSubsystem as I mentioned above though, so REST calls are allowed.

Please let me know if you need help with anything else and I apologize for any inconveniences that this might cause you,

Thank you,

Veronica

Hello Veronica

Now that explains a lot! Thank you for your answer.

I've managed to get the App now running on my personal instance.

Please let me know when you've modified the version.

Best regards

Georgios

Hi Georgios,

I am glad it works now. I will keep you posted on the update.

Thank you,

Veronica

Hello,

The link to the apk is not valid anymore - can somebody point me to correct location of the android enhanced application? This one: Android Smartphones and Thingworx - ThingWorx : ThingWorx is a different application.

Thanks in advance for quick reply!

BryanK
14-Alexandrite
(To:jacekgra)

Has anybody got access to the enhanced version?

The APK is the old version that does not work

BryanK
14-Alexandrite
(To:BryanK)

Hi All,

So I'm still looking for the enhanced version.... If you have it please feel free to share.

I did find the issue with the old version. part of the url is hardcoded. So if you are tying to connect to a https site its not going to work.

You need to edit the java code and either change the URL or just take it out completely.

I took mine out and now I have to enter the correct url portion. eg: https://ipadress:port  or http://ipadress:port

I am willing to share...

Top Tags