Skip to content

Update for FONA3G, SMS #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 67 commits into from
Jun 1, 2020
Merged

Update for FONA3G, SMS #6

merged 67 commits into from
Jun 1, 2020

Conversation

brentru
Copy link
Member

@brentru brentru commented Jun 1, 2020

This pull request adds:

  • Updated SMS receive mechanism

    • Ring Indicator (RI) pin added to fona initialization.
    • Move to polling a receive_sms() method instead of directly polling the serial.
      • receive_sms allows for optionally checking UART or RI for incoming SMS messages.
    • Examples (sms & sms_response) updated
  • Removed public access to uart serial functions (readline, uart write) from user-code

  • Fona 3G compatibility

    • New fona_3g.py child class, contains methods compatible with the SIMCom SIM5320 module's AT command set.
    • adafruit_fona_socket queries and uses the SIM5320's tcp transmit timeout, socket writes now use user-set timeouts
    • Examples updated and tested with FONA808 and FONA3G
  • adafruit_fona_network class added for connecting and interacting with GSM and CDMA cellular networks.

brentru added 30 commits May 20, 2020 12:22
@brentru
Copy link
Member Author

brentru commented Jun 1, 2020

Tests

Fona 3G: Fona3G tests ran on Adafruit CircuitPython 5.3.0 on 2020-04-29; Adafruit ItsyBitsy M4 Express with samd51g19 with FONA 3G Breakout.

fona_simpletest.py, FONA3G

code.py output:
FONA Webclient Test
Attaching to network...
...
Attached!
Connecting to network...
Connecting to network...
Network Connected!
My IP address is:  30.90.87.130
IP lookup adafruit.com: "104.20.38.240"
Fetching text from http://wifitest.adafruit.com/testwifi/index.html
----------------------------------------
This is a test of Adafruit WiFi!
If you can read this, its working :)

----------------------------------------

Fetching json from http://api.coindesk.com/v1/bpi/currentprice/USD.json
----------------------------------------
{'time': {'updated': 'Jun 1, 2020 15:59:00 UTC', 'updatedISO': '2020-06-01T15:59:00+00:00', 'updateduk': 'Jun 1, 2020 at 16:59 BST'}, 'disclaimer': 'This data was produced from the CoinDesk Bitcoin Price Index (USD). Non-USD currency data converted using hourly conversion rate from openexchangerates.org', 'bpi': {'USD': {'code': 'USD', 'description': 'United States Dollar', 'rate_float': 9537.86, 'rate': '9,537.8641'}}}
----------------------------------------
Done!



Press any key to enter the REPL. Use CTRL-D to reload.

fona_aio_post.py, fona3g

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Attached!
Connecting to network...
Connecting to network...
Network Connected!
Posting data...{'created_at': '2020-06-01T16:07:19Z', 'id': '0EF1K5YZVTSCNBFSQ425XAKMNR', 'expiration': '2020-07-31T16:07:19Z', 'created_epoch': 1591027639, 'feed_id': 997503, 'value': '0', 'feed_key': 'test'}
OK
Posting data...{'created_at': '2020-06-01T16:07:54Z', 'id': '0EF1K69NCDZPJ3H2KFPJJJ90AA', 'expiration': '2020-07-31T16:07:54Z', 'created_epoch': 1591027674, 'feed_id': 997503, 'value': '1', 'feed_key': 'test'}
OK
Posting data...{'created_at': '2020-06-01T16:08:29Z', 'id': '0EF1K6MA0SDYYQYD4X7FN0GDR2', 'expiration': '2020-07-31T16:08:29Z', 'created_epoch': 1591027709, 'feed_id': 997503, 'value': '2', 'feed_key': 'test'}
OK
Posting data...{'created_at': '2020-06-01T16:09:04Z', 'id': '0EF1K6YX3F5WNBWJVB68G8TB7D', 'expiration': '2020-07-31T16:09:04Z', 'created_epoch': 1591027744, 'feed_id': 997503, 'value': '3', 'feed_key': 'test'}
OK

fona_sms_response.py, FONA3G
note: sms rx'd by phone is OK.

code.py output:
FONA SMS Response
Connected to network!
RSSI: -84dB
FONA Ready!
Waiting for SMS...
Incoming SMS from +: Test
Sending response...
SMS Sent!

fona_sms.py, FONA3G
note: sms rx'd by phone is as expected, code prints 13 sms messages

code.py output:
FONA SMS
Connected to network!
RSSI: -84dB
Sending SMS...
SMS Sent!
13 SMS's on SIM Card
('140404', 'Sorry, this service is not available.')
...
('140404', 'Sorry, this service is not available.')

fona_cheerlights, untested on fona3g since itsybitsy m4 does not have a neopixel


FONA 808: Fona808 tests ran on Adafruit CircuitPython 5.3.0 on 2020-04-29; Adafruit Metro M4 Express with samd51j19 with FONA808 shield.

fona_simpletest.py

code.py output:
FONA Webclient Test
Attaching to network...
Attaching to network...
Attaching to network...
Attaching to network...
Attached!
Connecting to network...
Network Connected!
My IP address is: 50.54.46.49
IP lookup adafruit.com: "104.20.39.240"
Fetching text from http://wifitest.adafruit.com/testwifi/index.html
----------------------------------------
This is a test of Adafruit WiFi!
If you can read this, its working :)

----------------------------------------

Fetching json from http://api.coindesk.com/v1/bpi/currentprice/USD.json
----------------------------------------
{'time': {'updated': 'Jun 1, 2020 16:21:00 UTC', 'updatedISO': '2020-06-01T16:21:00+00:00', 'updateduk': 'Jun 1, 2020 at 17:21 BST'}, 'disclaimer': 'This data was produced from the CoinDesk Bitcoin Price Index (USD). Non-USD currency data converted using hourly conversion rate from openexchangerates.org', 'bpi': {'USD': {'code': 'USD', 'description': 'United States Dollar', 'rate_float': 9589.7, 'rate': '9,589.7044'}}}
----------------------------------------
Done!

fona_aio_post.py

code.py output:
Attaching to network...
Attaching to network...
Attaching to network...
Attached!
Connecting to network...
Connecting to network...
Connecting to network...
Network Connected!
Posting data...{'created_at': '2020-06-01T16:25:46Z', 'id': '0EF1KGGRJYVT8YD9VEZ719W2P8', 'expiration': '2020-07-31T16:25:46Z', 'created_epoch': 1591028746, 'feed_id': 997503, 'value': '0', 'feed_key': 'test'}
OK
Posting data...{'created_at': '2020-06-01T16:26:27Z', 'id': '0EF1KGXBES8NG2XK7X8N1XB3FK', 'expiration': '2020-07-31T16:26:27Z', 'created_epoch': 1591028787, 'feed_id': 997503, 'value': '1', 'feed_key': 'test'}
OK
Posting data...{'created_at': '2020-06-01T16:27:08Z', 'id': '0EF1KH9VE1TSQ5XZ8PPFJJ3RKG', 'expiration': '2020-07-31T16:27:08Z', 'created_epoch': 1591028828, 'feed_id': 997503, 'value': '2', 'feed_key': 'test'}
OK
Posting data...{'created_at': '2020-06-01T16:27:49Z', 'id': '0EF1KHPBJ98CQYZ4RRH9GQ7BEH', 'expiration': '2020-07-31T16:27:49Z', 'created_epoch': 1591028869, 'feed_id': 997503, 'value': '3', 'feed_key': 'test'}
OK
Posting data...{'created_at': '2020-06-01T16:28:30Z', 'id': '0EF1KJ2VQVQMKGTFVF805KZXJY', 'expiration': '2020-07-31T16:28:30Z', 'created_epoch': 1591028910, 'feed_id': 997503, 'value': '4', 'feed_key': 'test'}
OK
Posting data...{'created_at': '2020-06-01T16:29:11Z', 'id': '0EF1KJF8JX0RDWA8XK65DHJAW1', 'expiration': '2020-07-31T16:29:11Z', 'created_epoch': 1591028951, 'feed_id': 997503, 'value': '5', 'feed_key': 'test'}
OK
Posting data...{'created_at': '2020-06-01T16:29:52Z', 'id': '0EF1KJVT20VAW4T2P09TJA0GBH', 'expiration': '2020-07-31T16:29:52Z', 'created_epoch': 1591028992, 'feed_id': 997503, 'value': '6', 'feed_key': 'test'}
OK
Posting data...{'created_at': '2020-06-01T16:30:33Z', 'id': '0EF1KK8CPFEEDAG77BXHAGQ2QM', 'expiration': '2020-07-31T16:30:33Z', 'created_epoch': 1591029033, 'feed_id': 997503, 'value': '7', 'feed_key': 'test'}
OK
Posting data...{'created_at': '2020-06-01T16:31:14Z', 'id': '0EF1KKMXBN5Q0SVNN70FZF11WW', 'expiration': '2020-07-31T16:31:14Z', 'created_epoch': 1591029074, 'feed_id': 997503, 'value': '8', 'feed_key': 'test'}
OK
Posting data...{'created_at': '2020-06-01T16:31:51Z', 'id': '0EF1KM07K099MQBNC1PG3CENTC', 'expiration': '2020-07-31T16:31:51Z', 'created_epoch': 1591029111, 'feed_id': 997503, 'value': '9', 'feed_key': 'test'}
OK

fona_sms.py

code.py output:
FONA SMS
Connecting to network...
Connecting to network...
Connecting to network...
Connected to network!
RSSI: -86dB
Sending SMS...
SMS Sent!
15 SMS's on SIM Card
('140404', 'Sorry, this service is not available.')
...
('140404', 'Sorry, this service is not available.')

fona_sms_response.py

code.py output:
FONA SMS Response
Connecting to network...
Connecting to network...
Connecting to network...
Connected to network!
RSSI: -94dB
FONA Ready!
Waiting for SMS...
Incoming SMS from +: Test
Sending response...
SMS Sent!

@ladyada ladyada merged commit 6d63837 into adafruit:master Jun 1, 2020
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Jun 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants