@jkeyser
never mind, changing gain fixed it
adc0.atten(machine.ADC.ATTN_11DB)
@jkeyser
never mind, changing gain fixed it
adc0.atten(machine.ADC.ATTN_11DB)
I have a Core 2 and the M5GO BOTTOM2.
Attached to port B on the battery is a circuit that outputs a voltage between 0-3.3v. The output of the circuit is attached to GPIO 36. When plugged in, adc.read() always returns 4095, and when unplugged reads 0. It should be reading 1.5v (measured with multimeter). Any ideas what could be going wrong?
from m5stack import *
from m5stack_ui import *
from uiflow import *
import machine
import time
screen = M5Screen()
screen.clean_screen()
screen.set_screen_bg_color(0xFFFFFF)
v = None
label0 = M5Label('label0', x=77, y=74, color=0x000, font=FONT_MONT_14, parent=None)
adc0 = machine.ADC(36)
adc0.atten(machine.ADC.ATTN_0DB)
adc0.width(machine.ADC.WIDTH_12BIT)
while True:
v = adc0.read()
label0.set_text(str(v))
wait_ms(5)
@gavin67890 I was able to get it working with 32/33 just by assigning with
uart1 = machine.UART(1, tx=32, rx=33)
which it looks like is the same the guy did in the video
@jkeyser if anyone comes across this in the future, at least on the core 2 the correct pins are 33/32
Trying to get this working, but am unable to send/receive anything at all https://shop.m5stack.com/products/rs485-module
Ive tried on the core (pins 17/16) and core 2 (pins 14/13).
For testing im just running this very basic code but can only get 'None' as a response. To send data im just using YAT and a USB->RS485 convertor which I have tested using a known-working device. Any ideas of what might be wrong?
from m5stack import *
from m5ui import *
from uiflow import *
uart1 = machine.UART(1, tx=14, rx=13)
uart1.init(9600, bits=8, parity=None, stop=1)
while True:
print(uart1.readline())
wait_ms(500)
@felmue
just tried, but the same thing happened.
One thing i did notice was if i initialize the LTE modem first, i dont get the index out of range error, but only the gps works. All the modem status checks such as get_single_quality() get_network_registration() return false as if it isnt even there.
I have these 2 modules along with the core 2. The LTE module is on pins 14/13, and the gps is on 1/3. LTE module is being powered externally.
https://shop.m5stack.com/products/gps-module
https://shop.m5stack.com/collections/m5-modules/products/com-lte-modulesim7600g?variant=35800524488868
When used separately, everything works fine, but when using both at the same time i get this error as soon as i try to initialize them.
File "<string>", line 35, in <module>
File "comx/lte.py, line 27, in __init__
File "libs/simcom/common.py", line 164, in ...
IndexError: list index out of range
@ajb2k3 Maybe im misunderstanding how it works, but I believe you have to upload the certificates to the modem itself using AT commands.
What i ended up doing was uploading the certs to the device, then just doing an open() in python, then sent those over UART using AT commands to the modem. Everything is working fine now, but not sure if this is the 'proper' way to do it.
@ajb2k3 normally I use the vscode extension, but for basic testing right now im using uiflow
How should i go about uploading certificates for mqtt to the LTE module?
Mainly im looking for how they should be formatted. Currently im just copy-pasting the raw text from the .pem file and uploading it over UART/AT commands, but i keep getting ssl errors and i suspect its because the certificates are not being read in correctly. Ive also tried a string with \n after each line.
EX:
AT+CCERTDOWN="clientcert.pem", 1219
> {raw string of .pem cert}
@felmue
Thanks, while looking into that I found i wasn't also unable to open any sort of connection to send AT commands. Turns out i misunderstood the dip settings for the core 2. Set to 16/17 on the modem and 14/13 on uiflow init and i have communication now.
Using this module with an external power supply along with the Core 2. No other modules attached at the moment.
https://shop.m5stack.com/products/com-lte-modulesim7600g
Only code uploaded is the example provided on uiflow, but i cant get any sort of response. The only output i get is "Text" in the top left of the screen. The program seems to hang during init and never makes it past that point. Confirmed DC power switch is on the correct setting, as well as the tx/rx dip switches.
Flashing the easyloader results in no output to the screen, as well as a high pitched ringing from the modem
Setting COM.X to true on m5burner gives the error 'module stable timeout'
from m5stack import *
from m5stack_ui import *
from uiflow import *
from comx.lte import LTE
screen = M5Screen()
screen.clean_screen()
screen.set_screen_bg_color(0xFFFFFF)
resp = None
label0 = M5Label('label0', x=33, y=36, color=0x000, font=FONT_MONT_14, parent=None)
label1 = M5Label('label1', x=37, y=63, color=0x000, font=FONT_MONT_14, parent=None)
label2 = M5Label('label2', x=35, y=91, color=0x000, font=FONT_MONT_14, parent=None)
label3 = M5Label('label3', x=36, y=114, color=0x000, font=FONT_MONT_14, parent=None)
lte = LTE(tx=13, rx=5)
label0.set_text(str(lte.check_status()))
label1.set_text(str(lte.get_single_quality()))
label2.set_text(str(lte.get_network_registration()))
label3.set_text(str(lte.get_gprs_network_registration()))
while True:
if str((lte.get_gprs_network_registration())) == '1':
# echo "test"
resp = lte.http_get('http://www.m2msupport.net/m2msupport/test.php')
if resp:
label4.set_text(str(resp[1]))
wait_ms(2)
@closedcolobus havent solved it yet unfortunately. Right now i just have 'import main' in boot.py which at least starts my program every boot, trying to look into modifying the firmware somehow but havent made much progress yet
@ajb2k3 Currently using the Core 2, and id say intermediate experience with micropython. I'm able to get it to autostart main.py on boot, but only after it displays the boot logo and then the main menu for a few seconds. On m5burner disabling "show boot menu" doesn't seem to do anything.
Is there anyway to skip the uiflow logo + menu and immediately start main.py?