more fixes

This commit is contained in:
gijsio
2020-07-31 13:50:01 +02:00
parent 33e2619602
commit 18f36adec3
4 changed files with 87 additions and 48 deletions

View File

@@ -19,6 +19,8 @@ or in the terminal as shown here: (Example is an Expansion board 3.1 on MacOS)
* If it does show up, the expansion module is connected and recognised. This also means the USB cable and board are connected correctly. Contintue to [step 5](#step-5)
* If it shows up with the Device ID in DFU update mode, check [here](/updatefirmware/expansionboard/).
* If it does not show up, continue to [step 2](#step-2)
### Step 2
@@ -50,43 +52,30 @@ etc
### Step 5
If you reached this step, the expansion board's USB connection is fully operational.
Once the USB device shows up and gets assigned a COM port (in Windows), the Pymakr plugin will try to connect to it, however, there is no py- module to connect to yet. If this is not the case,
Once the expansion board shows up and gets assigned a COM port in Windows, or a `/dev/tty-` address in MacOS or Linux, the Pymakr plugin will try to connect to it. However, there is no py- module to connect to yet, so it will wait forever.
Insert your py- module with the button / RGB LED towards the USB connector, like shown here: (This works the same for all modules)
Now is the time to insert your py- module. Always place the button / RGB LED towards the USB connector, like shown here: (This works the same for all modules and expansion board variants)
![](/gitbook/assets/expansion_board_3_lopy4.png)
> Note: For the expansion board, make sure that at least the jumpers for TX RX LED and RTS are inserted correctly.
> Note: For the Expansion board, make sure that at least the jumpers for TX RX LED and RTS are inserted correctly.
* The module should flash the RGB LED blue every 4 seconds (unless you disabled the hearbeat last time). This indicates the module is operational.
---
* If it does not flash, the module might be constantly crashing or in programming mode. You can check this by viewing the Pymakr REPL terminal in VSCode or Atom. The text will be similar to ..
```
Connecting to /dev/tty.usbmodemPy37219b1...
ets Jun 8 2016 00:22:57
> Note: all (new) -py modules give a flashing blue led every 4 seconds. This is the heartbeat. Once you see this, the module is guarenteed to work. It is also possible to disable this.
rst:0x1 (POWERON_RESET),boot:0x6 (DOWNLOAD_BOOT(UART0/UART1/SDIO_REI_FEO_V2))
waiting for download
```
This means GPIO0, (P2) of the py module is pulled LOW and the module keeps itself in programming mode. This problem can be caused by the expansion board, in which case you should update the firmware, described here: https://docs.pycom.io/pytrackpysense/installation/firmware/. If your expansion board fails to update, check this link: https://forum.pycom.io/topic/4911/expansion-board-3-1-issues?_=1593093156432.
> In some instances you will have to restart your IDE or computer to pick up the connection again.
Note: The expansion board firmware updater has some issues in MacOS, causing the dfu-util: set alt interfaces zero error, any other operating system works fine
If you inserted the module and:
* The green LED on the Expansion board turned off
* The module gets hot
* The expansionboard is now disconnected
Go to [step 8](#step-8)
If it does not give that, try the safe boot procedure described here: https://docs.pycom.io/gettingstarted/programming/safeboot/.
If, on the other hand, the module now shows connected in Pymakr, but keeps coredumping or does not return anything, go to the next step
Okay, when you got this far, it means that
Your expansion board is operational
Your -py module is operational
If you still cannot get the device to show up in your computer, please check that your USB cable has a data connection.
Showing up in Pymakr, but no response / keeps coredumping
You should now receive something similar to this in the REPL terminal of Pymakr, after you press the reset button:
>>> ets Jun 8 2016 00:22:57
### Step 6
First, try to press the reset button on the device. The output should look similar to this:
```
ets Jun 8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
@@ -101,17 +90,44 @@ entry 0x400a05bc
Pycom MicroPython 1.20.2.rc9 [v1.11-1a257d8] on 2020-06-10; LoPy4 with ESP32
Type "help()" for more information.
>>>
If this is not the case, you should use the Firmware updater tool: https://docs.pycom.io/gettingstarted/installation/firmwaretool/ to update your module to the latest firmware. A firmware update might also solve some of the Guru-Meditation errors, in that case, also make sure the NVM is formatted using the advanced option:
```
This means the module is in working condition and you are done! On the other hand, if it does not do this, but continues to crash or return nothing, try to do a `safe-boot` like described [here](/gettingstarted/programming/safeboot/). That should bring the device in a mode where the python code is disabled, or the previous firmware is loaded.
If your output looks like this:
```
ets Jun 8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x6 (DOWNLOAD_BOOT(UART0/UART1/SDIO_REI_FEO_V2))
waiting for download
```
Pin `P2` is stuck pulled `LOW`, causing the controller to expect a new firmware upload. This can be caused by ... updating expansion board?
If your expansion board fails to update, check this [Forum post](https://forum.pycom.io/topic/4911/expansion-board-3-1-issues?_=1593093156432)
> Note: The expansion board firmware updater has some issues in MacOS, causing the dfu-util: set alt interfaces zero error, any other operating system works fine
If that does not help, try to use the [Firmware Updater tool](/updatefirmware/device/). make a more exhaustive guide here.
> After updating the firmware, the heartbeat will be re-enabled.
### Step 7
Your expansion board is operational
Your -py module is operational
## Step 8
Measure voltages.
If you end up here, your module's hardware is most probably broken. Either the voltage regulator died, or the micrcontroller inside is not responding to any inputs anymore.
## Notes
If the firmware upgrade tool returns:
“Failed to connect to ESP32: Timed out waiting for packet header”
And you followed all previous steps (no blinking heartbeat LED, no orange LED on the expansionboard 3.0, etc.) The probability that your board is dead is quite high. It is quite unusual for both an expansion board and a -py module to die simultaneously, without user error. Generally, this is caused by reversing the polarity on the battery charger, thus breaking both modules.
Intermittent problems
# Intermittent problems
Intermittent problems are generally caused by
Unstable power supply

View File

@@ -4,6 +4,7 @@ aliases:
---
The following tutorials demonstrate the use of the LoRa functionality on the LoPy. LoRa can work in 2 different modes; **LoRa-MAC** (which we also call Raw-LoRa) and **LoRaWAN** mode.
> Note: LoRa will not work with Pygate firmware loaded on your device. It will return a `/event_groups.c:498 (xEventGroupClearBits)- assert failed!` error.
* **LoRaWAN mode** implements the full LoRaWAN stack for a class A device. It supports both OTAA and ABP connection methods, as well as advanced features like adding and removing custom channels to support "special" frequencies plans like the those used in New Zealand. There are two basic ways of accessing the LoraWAN network:
* [LoRaWAN ABP](../lora/lorawan-abp/)

View File

@@ -17,26 +17,26 @@ import socket
lte = LTE()
lte.init()
#when using verizon, use
#lte.init(carrier=verizon)
#when usint AT&T use,
#use lte.init(carrier = at&t)
#some carriers have special requirements, check print(lte.send_at_cmd("AT+SQNCTM=?")) to see if your carrier is listed.
# e.g. lte.init(carrier='verizion')
#some carriers do not require an APN
#also, check the band settings, for some carriers they auto-configure.
#also, check the band settings with your carrier
lte.attach(band=20, apn="your apn")
print("attaching..",end='')
while not lte.isattached()
time.delay(0.25)
print('.')
print('.',end='')
print(lte.send_at_cmd('AT!="fsm"')) # get the System FSM
print("LTE modem attached!")
print("attached!")
lte.connect()
print("connecting [##",end='')
while not lte.isconnected():
time.sleep(0.25)
print('#')
print('#',end='')
#print(lte.send_at_cmd('AT!="showphy"'))
print(lte.send_at_cmd('AT!="fsm"'))
print("LTE modem connected!")
print("] connected!")
print(socket.getaddrinfo('pycom.io', 80))
@@ -49,6 +49,24 @@ The last line of the script should return a tuple containing the IP address of t
>Note: the first time, it can take a long while to attach to the network.
# LTE disconnecting
When the LTE disconnects in an unexpected situation, for example when the signal is lost, `lte.isconnected()` will still return `True`. Currently, there is a solution using the callback and handler function listed below:
```python
from network import LTE
import time
from sleep import sleep
import machine
def cb_handler(arg):
print("CB: LTE Coverage lost")
print("CB: sleep", s)
print("CB: deinit")
lte.deinit()
print("CB: reset")
machine.reset()
lte.lte_callback(LTE.EVENT_COVERAGE_LOSS, cb_handler)
```
# LTE Troubleshooting guide
Below, we review the responses from `print(lte.send_at_cmd('AT!="fsm"'))`. If you are having trouble attaching to the network, or getting a connection up and running, this might give some direction into what is wrong. We are mainly looking at the status of the top two indicators for now.

View File

@@ -24,6 +24,8 @@ The last 5 numbers define the firmware version. A higher number represents a new
> Note: The prefered method for updating the LTE modem is using upgdiff- files, as these updates are faster. Check in the zip archive wheter a upgdiff- update for your version is available. When using a upgdiff- file, you do not need to use `updater.elf`
> Using `sqnsupgrade` does not currently work properly in the pygate firmware
There are several different ways to update the firmware of the LTE modem.
1. [Flash](/updatefirmware/ltemodem/#flash) (slow)
2. [SD card](/updatefirmware/ltemodem/#sd-card) (fastest)
@@ -72,13 +74,13 @@ Announcements & News --> Announcements for members only --> the Firmware Files f
```python
import sqnsupgrade
sqnsupgrade.run('/sd/upgdiff_old-to-new.dup')
#if no upgdiff is available, run the following instead
#sqnsupgrade.run('/sd/name.dup')
#WARNING! If you are updating from version 33080, use the .elf file as well
#sqnsupgrade.run('/sd/name.dup', '/sd/updater.elf')
# if no upgdiff is available, run the following instead
# sqnsupgrade.run('/sd/name.dup')
# WARNING! If you are updating from version 33080, use the updater.elf file as well
# sqnsupgrade.run('/sd/name.dup', '/sd/updater.elf')
```
>Note: Replace `name.dup` with the actual filename. There are different versions for `CAT-M1` and `NB-IoT`
>Note: Replace `name.dup` or `z`upgdiff_old-to-new.dup` with the actual filename. There are different versions for `CAT-M1` and `NB-IoT`
4. The command will now make sure the firmware is updated. This takes about 5 minutes. Note that the update may seem to 'stall' around 7-10% and again at 99%. This is completely normal.
>Note: **Do not disconnect power to the module during the updating process**
@@ -88,7 +90,7 @@ Announcements & News --> Announcements for members only --> the Firmware Files f
## USB
If you do not have an SD card available, you can use the existing USB-UART interface. For this you will need to install
* [Python 3](https://www.python.org/downloads), if it's not directly available through your OS distributor
* [Python 3](https://www.python.org/downloads)
* [PySerial](https://pythonhosted.org/pyserial/pyserial.html#installation)
* [sqnsupgrade python script](https://github.com/pycom/pycom-libraries/tree/master/lib/sqnsupgrade)
@@ -100,14 +102,16 @@ If you do not have an SD card available, you can use the existing USB-UART inter
2. Take note of the Serial port used and close the IDE.
3. Go to the directory where you saved the `sqnsupgrade` script and run the following commands in the command line / terminal
```
```python
$ python3
>>> import sqnsupgrade
>>> sqnsupgrade.run('Serial_Port', '/path/to/name.dup', '/path/to/updater.elf')
>>> sqnsupgrade.run('Serial_Port', '/path/to/name.dup')
# WARNING! If you are updating from version 33080, use the updater.elf file as well
# >>> sqnsupgrade.run('Serial_Port', '/path/to/name.dup', '/path/to/updater.elf')
```
>Note: Replace the paths and `name.dup` with the actual files. There are different versions for `CAT-M1` and `NB-IoT`
4. The `updater.elf` script will make sure the firmware is updated. It takes about 5 minutes. Note that the update may seem to 'stall' around 7-10% and again at 99%. This is completely normal.
4. The update is now running. Note that the update may seem to 'stall' around 7-10% and again at 99%. This is completely normal.
>Note: **Do not disconnect power to the module during the updating process**
5. The updater will show `SYSTEM VERSION` when it is done, and return control to REPL.