M5stack GPS, use Serial2 and Serial1
-
This device : ATOMIC GPS Base (M8030-KT) uses Serial2 to communicate with the GPS chip.
Now i am trying to use Serial1.begin(19200, SERIAL_8N1, 32, 26) to communicate with another device.
I know that this device is working, i have tested it with master module.
I have also switche TX and RX ports. Still no respond from the slave.So i was wondering, is it possible to use Serial1 on M5atom lite with the 32 and 26 ports?
Thanks -
Hello @HappyUser
have you tried directly looping back TX into RX? E.g. connect G26 to G32? Then try withsomething like this in the
loop()
:static uint32_t lastTime = 0; if(millis() - lastTime > 5000) { lastTime = millis(); Serial1.println("hello"); } if(Serial1.available() > 0) { while(Serial1.available() > 0) { Serial.print(Serial1.readStringUntil('\n')); } Serial.println(); }
Thanks
Felix -
@felmue said in M5stack GPS, use Serial2 and Serial1:
Well, now i need to recheck what i have been doing.
Your example works both on M5Stick (using ports 0 and 26) and M5Atom (ports 26 and 32).Thank you, i have some work to do, Ha Ha