@John93
ESP32 and A9G are very different pieces of electronics with different tasks. ESP32 using WiFi connection, while A9G - GPRS. I.e. ESP32 need WiFi router to be functional, but A9G is suitable for mobile task such as automobile/bicykle GPS tracker via blynk, or to control something somewhere very far from LAN cables.
@GarudaOne
Well, will check it later, when I’ll be at home.
P.S. Just a thought. Try to involve some string exchange with Blynk - say, send any number to virtual pin. or print some string (say, every 5 seconds) to your terminal with timer. Maybe the reason is in COM port, which is in idle state while your blynk.run() loop just running itself.
P.P.S. It seems, it is common problem for Ampy - I have never used it before.
@Alegz thanks very much. It works now–stop crashing now.
I still don’t know what the cause of my code error. Anyway, I will investigate more. I just used Blynk for 3 days so many things that I still need to understand and also my first MicroPython project.
Let me try to keep it running for several days to see how it performs.
What I needs more from this device is I2C for sensors and controlling a 4 channel relay. For bigger task, i will let my ESP32 and RPi handle it.
I see a post about using A9G for mailbox controller for more than 1 year without any issue.
@Alegz Its I2C works even though it doesn’t use the standard I2C for Micropython. Strangely, it work only on port 2 among the 3 i2c ports. For your microSD case, I don’t know if it is the same an issue on github there or not.
Currently, I am keep it running to Blynk with SHT30 and 4 relays. Let’s see how if it go smoothly.
So far it reboot a few times, I have no idea why yet.
@GarudaOne According to A9G puddung board schematic, only I2C2 has pull-up resistors and marked as I2C line. I2C1 is tied to SD card, and I2C3 is marked as IO ports. I guess, it is just software restriction to use 'em as I2C, but I’m not sure . Maybe it is worth to add pull-ups to other lines too, it’s subject to experiment.
@vshymanskyy , please help providing code for handling wifi disconnection , the function decorator @blynk.on(‘disconnected’) does not respond. I am working on ESP32.
/*************************************************************
Download latest Blynk library here:
https://github.com/blynkkk/blynk-library/releases/latest
Blynk is a platform with iOS and Android apps to control
Arduino, Raspberry Pi and the likes over the Internet.
You can easily build graphic interfaces for all your
projects by simply dragging and dropping widgets.
Downloads, docs, tutorials: http://www.blynk.cc
Sketch generator: http://examples.blynk.cc
Blynk community: http://community.blynk.cc
Follow us: http://www.fb.com/blynkapp
http://twitter.com/blynk_app
Blynk library is licensed under MIT license
This example code is in public domain.
*************************************************************
This example shows how to keep WiFi connection on ESP8266.
*************************************************************/
/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial
/* Fill-in your Template ID (only if using Blynk.Cloud) */
//#define BLYNK_TEMPLATE_ID "YourTemplateID"
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "YourAuthToken";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "YourNetworkName";
char pass[] = "YourPassword";
int lastConnectionAttempt = millis();
int connectionDelay = 5000; // try to reconnect every 5 seconds
void setup()
{
// Debug console
Serial.begin(9600);
Blynk.begin(auth, ssid, pass);
}
void loop()
{
// check WiFi connection:
if (WiFi.status() != WL_CONNECTED)
{
// (optional) "offline" part of code
// check delay:
if (millis() - lastConnectionAttempt >= connectionDelay)
{
lastConnectionAttempt = millis();
// attempt to connect to Wifi network:
if (pass && strlen(pass))
{
WiFi.begin((char*)ssid, (char*)pass);
}
else
{
WiFi.begin((char*)ssid);
}
}
}
else
{
Blynk.run();
}
}
@vshymanskyy Have tried all options, even modified the library to check status of wifi and reconnect , but not seem to be possible. I expect prompt support from Blynk team for potential customers. This is been lot of delay and my go to market time is prolonging.
I’m good in micro-python too guy , but as I said, 99% of the blynk user used C++
So micro-python is not a priority ATM for Blynk staff and I can understand that, not you ?
The wrong direction for you personally, but you have to remember that the majority of coders who work on IoT projects started with Arduino products and using C++
This is where the dominance of C++ for this type of hardware stems from, and it’s where companies like Blynk need to focus their resources to be competitive in the field.