Skip to content

Commit 5b9532a

Browse files
Merge pull request #103 from sixfab/dev
Release 0.3.0
2 parents 19c1668 + 51af373 commit 5b9532a

32 files changed

+1607
-144
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ cert/
44
### Configs
55
config.json
66

7+
### MacOS
8+
pico_lte/.DS_Store
9+
.DS_Store
10+
711
### VSCode Config
812
.vscode/
913

@@ -180,3 +184,4 @@ cython_debug/
180184
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
181185
#.idea/
182186

187+
package-lock.json

CHANGELOG.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Changelog
2+
3+
## [0.3.0] - 2023-10-21
4+
5+
### Added
6+
7+
- Add google sheets app.
8+
9+
### Changed
10+
11+
- Update gps output format as decimal.
12+
13+
14+
## [0.2.1] - 2023-09-13
15+
16+
### Added
17+
18+
- Add code examples for apps.
19+
20+
### Changed
21+
22+
- Improve HTTP fault catching.
23+
- Update Azure app document for simple usage.
24+
- Update README.md file for last changes and fix link redirects.
25+
26+
### Removed
27+
28+
- Delete I2C class initialization.
29+
- Remove ULP example.
30+
31+
### Fixed
32+
33+
- Fix response related error of Scriptr app.
34+
- Fix memory allocation error while using Azure app.
35+
36+
[0.2.1]: https://github.com/sixfab/pico_lte_micropython-sdk/tree/0.2.1
37+
[0.3.0]: https://github.com/sixfab/pico_lte_micropython-sdk/tree/0.3.0

README.md

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,40 +14,55 @@ an embedded framework to make easier cellular connections
1414

1515
</div>
1616

17-
## Description
18-
PicoLTE SDK is a framework that you can use in your embedded systems projects and **takes care of cellular communication** processes for you. It provides built-in application support for popular back-end services such as Amazon Web Services, Azure, ThingSpeak, Slack, and Telegram.
1917

20-
* Less than 40 lines when making a connection to a built-in application.
21-
* Support for SSL/TLS certification and their secure storage.
22-
* Easy-to-use GPS, HTTPS and MQTTS interfaces.
23-
* Chance to create your own application module with state machines.
18+
Pico LTE SDK is an innovative framework that enables developers to integrate cellular communication capabilities into their embedded systems projects seamlessly. Pico LTE SDK simplifies the complexities of wireless connectivity, allowing developers to focus on their applications rather than the intricacies of cellular communication processes.
19+
20+
This powerful SDK empowers developers to seamlessly integrate cellular capabilities into their projects, allowing your projects to communicate over wide areas using cellular networks.
21+
22+
One of the standout features of Pico LTE SDK is its comprehensive compatibility with popular backend services provided by Amazon Web Services (AWS), Azure, ThingSpeak, Slack, Scriptr.io and Telegram. This integration opens up a world of possibilities for leveraging the power of cloud-based services and enables seamless communication between embedded systems and the wider Internet ecosystem. Pico LTE SDK is a game-changer for developers seeking to integrate cellular communication capabilities into their Raspberry Pi Pico-based projects.
23+
24+
- **Easy Integration:** Enables seamless integration of cellular communication capabilities into embedded systems projects, specifically designed for the Sixfab Pico LTE board.
25+
- **Minimalistic Code:** Connecting to a built-in application requires less than 40 lines of code, reducing complexity and allowing for quick and efficient development.
26+
- **GPS Integration:** Easy-to-use GPS integration, enabling developers to incorporate location-based functionalities into their applications, leveraging cellular network-based positioning.
27+
- **Custom Application Modules:** With the Pico LTE SDK, developers have the flexibility to create their own application modules using the SDK. This feature allows for custom functionality tailored to specific project requirements.
28+
- **Versatile Protocols:** Pico LTE SDK simplifies the implementation of various protocols such as GPS, HTTPS, and MQTT. Developers can easily leverage these protocols for location-based services, secure web communication, and efficient machine-to-machine communication in IoT applications.
2429

2530
## Installation
26-
You can install the framework by cloning the repository to your local machine. You can also download the repository as a zip file and extract it to your local machine. After that, you can upload the `pico_lte` folder to your PicoLTE device's file system.
31+
32+
The installation of the SDK is provided in detail and step-by-step on the ["Pico LTE SDK for MicroPython"](https://docs.sixfab.com/docs/sixfab-pico-lte-micropython-sdk) page.
33+
34+
- Clone the repository to your local machine or download the repository as a zip and extract it on your local machine.
35+
36+
- After that, upload the "[pico_lte](./pico_lte/)" folder to the root directory of your Pico LTE device. That's all.
37+
2738

2839
## Usage
29-
Using the framework is pretty straightforward. A `main.py` file is needed to run in a MicroPython environment, therefore, please create a `main.py` script in your PicoLTE's file system. Import the framework with `from pico_lte.core import PicoLTE` line, and code your embedded project!
40+
Using the SDK is pretty straightforward.
3041

31-
**Note**: It is a must to have a tool to upload your `main.py` file or any example from our repository to your PicoLTE device. [Thonny IDE](https://thonny.org/) is a very common tool that has an easy GUI to perform this kind of operation. For a more compact and smaller size tool, we can recommend [Adafruit's Ampy](https://learn.adafruit.com/micropython-basics-load-files-and-run-code/install-ampy) to you.
42+
Import the SDK with `from pico_lte.core import PicoLTE` line, and code your IoT project!
3243

33-
For further reference about installing or usage, please refer to our documentation page. Also, Sixfab Community Portal is available for your questions and recommendations.
44+
For more references on installation or usage, please refer to our [documentation page](https://docs.sixfab.com/docs/sixfab-pico-lte-micropython-sdk). By examining the [example codes](./examples/) provided on the platforms, you can delve into further details. You can connect various sensors to the Pico LTE, collect data on temperature, humidity, and air quality, and transmit this data over the cellular network using the Pico LTE SDK.
45+
46+
Additionally, the Sixfab Community is available for any questions or suggestions you may have.
3447

3548
<p align="center">
36-
<a aria-label="Documentation on Sixfab.com" href="https://docs.sixfab.com/" target="_blank">
49+
<a aria-label="Documentation on Sixfab.com" href="https://docs.sixfab.com/docs/sixfab-pico-lte-introduction" target="_blank">
3750
<img alt="" src="https://img.shields.io/badge/Documentation-blue.svg?style=for-the-badge">
3851
</a>
39-
<a aria-label="Community on Sixfab.com" href="https://community.sixfab.com/" target="_blank">
52+
<a aria-label="Community on Sixfab.com" href="https://community.sixfab.com/c/sixfab-pico-lte/36" target="_blank">
4053
<img alt="" src="https://img.shields.io/badge/Community-blue.svg?style=for-the-badge">
4154
</a>
4255
</p>
4356

4457
## Configuration Files
4558
You can use a configuration file to increase maintainability of your embedded code. This file is named as `config.json` and stores necessary connection parameters which are designed for you to easily connect to the applications. You can find example files for each application and module in [CONFIGURATIONS.md](./CONFIGURATIONS.md) page.
4659

47-
This file has to be in the root directory of the PicoLTE device's file system.
60+
This file has to be in the root directory of the Pico LTE device's file system.
61+
62+
Please see the [Configure the Pico LTE SDK](https://docs.sixfab.com/docs/sixfab-pico-lte-micropython-sdk) page for more details.
4863

4964
## Contributing
5065
All contributions are welcome. You can find the guidelines in [CONTRIBUTING.md](./CONTRIBUTING.md).
5166

5267
## License
53-
Licensed under the [MIT license](https://choosealicense.com/licenses/mit/).
68+
Licensed under the [MIT license](https://choosealicense.com/licenses/mit/).

examples/__basic__/blink_led.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
"""
2+
3+
Example code for blinking the USER LED.
4+
5+
"""
6+
7+
import machine
8+
import utime
9+
10+
led = machine.Pin(22, machine.Pin.OUT)
11+
12+
while True:
13+
led.toggle()
14+
utime.sleep(1)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
"""
2+
3+
Example code for button controlled LED toggle.
4+
When the USER button is pressed, the light turns on. When the button is not pressed, the light turns off.
5+
6+
"""
7+
8+
import machine
9+
import utime
10+
11+
led = machine.Pin(22, machine.Pin.OUT) # We set up the pin to control the light.
12+
button = machine.Pin(21, machine.Pin.IN, machine.Pin.PULL_DOWN) # We set up the pin for the button.
13+
14+
while True:
15+
if button.value() == 0: # If the button is pressed (value is 0):
16+
led.on() # Turn on the light.
17+
else: # If the button is not pressed (value is 1):
18+
led.off() # Turn off the light.
19+
utime.sleep(0.1) # Wait for a short moment before checking again.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
"""
2+
3+
Example code for basic counter using USER button.
4+
Create a simple counter using a USER Button on the Pico LTE.
5+
When the button is pressed, the counter increases by one, and the updated value is printed in the terminal.
6+
7+
"""
8+
9+
import machine
10+
import utime
11+
12+
button = machine.Pin(21, machine.Pin.IN, machine.Pin.PULL_DOWN)
13+
counter = 0
14+
15+
while True:
16+
if button.value() == 0:
17+
counter += 1
18+
print("Counter:", counter)
19+
while button.value() == 0:
20+
pass # Wait for the button to be released
21+
utime.sleep(0.1)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
"""
2+
3+
Example code for control USER LED brightness with PWM.
4+
5+
"""
6+
7+
import machine
8+
import utime
9+
10+
led = machine.Pin(22, machine.Pin.OUT) # Set up a pin to control the LED.
11+
pwm_led = machine.PWM(led) # Initialize PWM (Pulse Width Modulation) for the LED.
12+
13+
while True:
14+
for duty_cycle in range(0, 65535, 1024): # Increase LED brightness.
15+
pwm_led.duty_u16(duty_cycle) # Set the LED brightness level.
16+
utime.sleep(0.01) # Pause to observe the change.
17+
for duty_cycle in range(64511, 0, -1024): # Decrease LED brightness.
18+
pwm_led.duty_u16(duty_cycle) # Set the LED brightness level.
19+
utime.sleep(0.01) # Pause to observe the change.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
"""
2+
3+
Example code for color cycling on NeoPixel LED.
4+
5+
"""
6+
7+
import machine
8+
import neopixel
9+
import utime
10+
11+
NUM_LEDS = 8
12+
pin = machine.Pin(15)
13+
np = neopixel.NeoPixel(pin, NUM_LEDS)
14+
15+
def color_cycle(wait):
16+
for i in range(NUM_LEDS):
17+
np[i] = (255, 0, 0) # Set LED color to red
18+
np.write()
19+
utime.sleep_ms(wait) # Wait for a short duration
20+
21+
for i in range(NUM_LEDS):
22+
np[i] = (0, 255, 0) # Set LED color to green
23+
np.write()
24+
utime.sleep_ms(wait) # Wait for a short duration
25+
26+
for i in range(NUM_LEDS):
27+
np[i] = (0, 0, 255) # Set LED color to blue
28+
np.write()
29+
utime.sleep_ms(wait) # Wait for a short duration
30+
31+
while True:
32+
color_cycle(100) # Call the color cycle function with a delay of 100 milliseconds
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
"""
2+
3+
Example code for rainbow effect on NeoPixel LED.
4+
5+
"""
6+
7+
8+
import machine
9+
import neopixel
10+
import utime
11+
12+
NUM_LEDS = 8
13+
pin = machine.Pin(15)
14+
np = neopixel.NeoPixel(pin, NUM_LEDS)
15+
16+
# Function for rainbow effect
17+
def rainbow_cycle(wait):
18+
for j in range(255):
19+
for i in range(NUM_LEDS):
20+
rc_index = (i * 256 // NUM_LEDS) + j
21+
np[i] = wheel(rc_index & 255) # Set LED color using wheel function
22+
np.write()
23+
utime.sleep_ms(wait)
24+
25+
def wheel(pos):
26+
if pos < 85:
27+
return (255 - pos * 3, pos * 3, 0) # Red to Green transition
28+
elif pos < 170:
29+
pos -= 85
30+
return (0, 255 - pos * 3, pos * 3) # Green to Blue transition
31+
else:
32+
pos -= 170
33+
return (pos * 3, 0, 255 - pos * 3) # Blue to Red transition
34+
35+
while True:
36+
rainbow_cycle(20) # Call the rainbow effect function with a delay of 20 milliseconds

examples/__basic__/qwiic.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
"""
2+
3+
Example code for SparkFun TMP102 Qwiic digital temperature sensor.
4+
5+
"""
6+
7+
import machine
8+
import time
9+
10+
# Establishing the I2C connection. '0' corresponds to the I2C driver.
11+
# The 'SDA' and 'SCL' parameters respectively specify the SDA and SCL pins.
12+
# The 'freq' parameter determines the I2C communication speed.
13+
14+
i2c = machine.I2C(0, scl=machine.Pin(13), sda=machine.Pin(12), freq=100000)
15+
tmp102_address = 0x48 # TMP102 I2C address (default set to 0x48).
16+
17+
# Temperature reading function
18+
def read_temperature():
19+
data = i2c.readfrom(tmp102_address, 2) # Read two bytes of data
20+
raw_temp = (data[0] << 8) | data[1] # Get the raw data combined
21+
temperature = (raw_temp >> 4) * 0.0625 # Convert raw data to temperature value
22+
return temperature
23+
24+
while True:
25+
temperature = read_temperature()
26+
print("Temperature: {:.2f} °C".format(temperature)) # Print the temperature value
27+
time.sleep(1) # Slow down the loop by waiting 1 second

0 commit comments

Comments
 (0)