Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

CODESYS Sensor App GPS Data

friedel
2021-07-14
2021-10-14
  • friedel - 2021-07-14

    Dear Codesys-Community,

    I'm new to the topic but this board helped me a lot so far, so thank you all!

    Currently I'm using the Codesys Sensor App to send data from a "Honor 8A" Android-Smartphone to a Raspberry Pi PLC. I receive sensor data such as the acceleration, proximity and light value but in the global variable list (NVL) the location data like latitude, longitude, altitude, speed etc. remain empty.The gps icon appears in the status bar and I allowed the app to track gps data - so this seems not to be the problem.

    Does anyone have a similiar problem? I have already tried the "Codesys Control Win SysTray"-PLC with the same result but i don't have the opportunity to try another Android-Smartphone.

    If there is no chance to read out the location data my other option would be to use a GPS sensor like the "NEO6M GPS Modul" via GPIO to the raspberry. Is there something like a library to translate the TX and RX Values into coordinates, speed etc. in Codesys?

    I would be very glad if anyone could help me with this! Many thanks in advance!

    Best regards
    Friedel

     
  • noobfx - 2021-08-10

    hello, i'm currently trying to do the same thing but can't connect the smartphone to codesys. can you explain to me how i do it? i can't find any instructions online and i have hardly any experience with codesys. Thank you

     
  • eschwellinger

    eschwellinger - 2021-08-10

    you need to check if you see the UDP netvars telegrams from your phone...either on the Control Win pc (wireshark) or on Raspberry Pi (tcpdump)

     
  • noobfx - 2021-08-11

    My problem is that I don't know how to call up the Codesys SensorApp data in Codesys. I try to use the home WiFi network. is the Codesys Control IP the same as that of my computer? I enter the IP of my computer and always get the same message 'send to failed: EPERM (Operation not permitted)'. What I have to do with codesys or call up for libraries? sorry, i'm really a beginner.

     
  • eschwellinger

    eschwellinger - 2021-08-13

    These network variables are automatically updated by netvars udp broadcast from the sensor app no need to call anything I guess.
    Phone and plc need to be in the same network. Therefore check if the phone send out net udp telegrams, that is how I would start to debug.

     
  • noobfx - 2021-08-16

    Thanks for help so far. Phone and plc are in the same WiFi. I can only enter the receiving IP address in the app. App settings cannot be selected. The UDP port is given me by the app and cannot be changed. I enter the UDP IP of the pc which the soft PLC is used in the app 'target ip address (codesys control)'. What do I have to set in the soft plc in order to receive the data? I thought of a 'network variable list (receiver)' but then I can't select 'import from file' because I don't have any from the app. Where is my mistake? thx

     
  • i-campbell

    i-campbell - 2021-08-18

    Hi noobfx. Here is what I did with Control Win, I can't imagine it not working also on a Pi:
    1. Install the .package from store in codesys installer
    2. Look in Package Manager > Details > Install Log for location of the example codesys project
    3. Open it from C:\Users\i-campbell\CODESYS Examples\SensorAppForAndroid\1.7.0.1\AndroidSensorApp.project
    4. Update All when prompted
    5. Ignore SensorDataGenerator
    6. Change SensorReceiver to a Control Win and download to my Control Win
    7. Download CODESYS Sensor App from the Google Play Store and run it
    8. Give permissions to send sensor data when prompted
    9. Type 255.255.255.255 as the Target IP address
    10. Flick "Send sensor data to control" to ON
    Then everything was functional.

    In truth I obtained the IP address from the matching NVL (Send) in the SensorDataGenerator, which the NVL (Receiver) was linked to. The IP address of the soft PLC worked also.

     
  • noobfx - 2021-08-18

    I didn't know that I needed another package for codesys in addition to the android app. I couldn't read that from the app store description. everything is running now.

    Thank you for your help.

     
  • friedel - 2021-10-14

    Hello together,

    thank you for your answers. I fixed my Problem having another one right now.

    For others reading this: I worked in a cellar, installing the Codesys Sensor App there, going under clear sky to send GPS-Data. This did not work. The application has to be installed while having GPS-fix to a few Satellites (you can check this with many GPS-Apps).

    So I'm getting GPS-Data now but within the application they're not properly refreshing. While other data such as acceleration are steadily refreshing within the task, the .location-data always stay the same from the moment i turned the application on. Only exception is when I go indoor (without GPS-fix) and return outside. Then GPS-data is refreshing but also stays the same after this refresh.

    I'd be glad if one of you could help me! Thank you in advance.

    Best regards

    Friedel

     

Log in to post a comment.