element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Arduino Forum Arduino with GSM sends data to Phone App
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Verified Answer
  • Replies 1 reply
  • Subscribers 388 subscribers
  • Views 953 views
  • Users 0 members are here
  • android
  • arduino
  • java
Related

Arduino with GSM sends data to Phone App

nicolaoscon96
nicolaoscon96 over 2 years ago

Hello, community of element14,

Long time since I last been here and I need your help once more. Am working on a project (a DIY remote control system for cars) using a phone app (not everyone can buy a new car with these cool features) :). This comes in 2 parts, one is the android application I have developed and the second is the "brain" that is in the car which is an Arduino mega with a GSM shield and some relays to control different things in the car, like the windows, start-stop the engine, lights, etc... Until now everything works perfectly for more than 4 months. Once the car's engine turns off the system comes online, and sends an SMS that is online. Instead of writing and sending the commands one by one from the phone's SMS app, I made an app with buttons that when you press it sends a preinstalled SMS directly to the Arduino (for example when I press the start engine it will send an SMS engine_Start) and the Arduino will control the relays to start the engine. The image I attached is the GUI that is still in development. At the top right and left sides are some text views for current fuel and temperature. So until now, this was kinda one-way communication from the phone's app to the Arduino although I get a report back when each command is being executed. I want to add something else as well.

And this is where I need your help. I want to send the data from Arduino to the phone via SMS like is working now in a String and the app will break it and at the data to the corresponding place. For example, take the temperature from a sensor         (int inTemp) and the fuel level (int fuelLevel) and add them in a String like (String data ="&" + inTemp + "&" + fuelLevel) and when the SMS comes back to the phone the app will break that SMS the String and separate the data by knowing that anything after the symbol & is considered data and add them in the textview.

Did anyone work with anything like this? 

Note the application is written in Java and I use an Android phone.

 image

Regards,

Nikolas

  • Sign in to reply
  • Cancel

Top Replies

  • shabaz
    shabaz over 2 years ago +1 verified
    Hi, I have not done it, but you might want to pick some standard format, and then there may be existing Java code to do the parsing that you desire. Otherwise you'll have to write the code yourself,…
Parents
  • shabaz
    +1 shabaz over 2 years ago

    Hi,

    I have not done it, but you might want to pick some standard format, and then there may be existing Java code to do the parsing that you desire. Otherwise you'll have to write the code yourself, but I don't see the issue, it is usually straightforward to split a string into tokens and search for text and pull out fragments of the string. These are all typical features of string libraries in any language (but you should write higher-level functions to deal with your data, if you intend to create a custom format for which there may be no existing code online).

    Personally, I like JSON, but you may find it is too verbose for SMS. There are standards you could check like https://smpp.org/ I think they mention a TLV format (i.e. tag/length/value) for instance. There are many possible candidate formats, so it's really up to you, whatever you feel comfortable with, and if you can find existing code, or if you are planning on writing your own using (say) string libraries.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Reject Answer
    • Cancel
Reply
  • shabaz
    +1 shabaz over 2 years ago

    Hi,

    I have not done it, but you might want to pick some standard format, and then there may be existing Java code to do the parsing that you desire. Otherwise you'll have to write the code yourself, but I don't see the issue, it is usually straightforward to split a string into tokens and search for text and pull out fragments of the string. These are all typical features of string libraries in any language (but you should write higher-level functions to deal with your data, if you intend to create a custom format for which there may be no existing code online).

    Personally, I like JSON, but you may find it is too verbose for SMS. There are standards you could check like https://smpp.org/ I think they mention a TLV format (i.e. tag/length/value) for instance. There are many possible candidate formats, so it's really up to you, whatever you feel comfortable with, and if you can find existing code, or if you are planning on writing your own using (say) string libraries.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Reject Answer
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube