the Serial1 port shuts off and restarts esp12f #5675
Replies: 1 comment
-
Posted at 2017-08-24 by Wilberforce How are you powering the esp8266 and module- if it is via the USB through the esp8266, there might not be enough mA to cope with the load. Can you connect to a 3.3v source of st least 1amp? Posted at 2017-08-25 by Alexander Power not via USB. Here in this place, the module hangs and restarts. function Start_modem(){
}); Posted at 2017-08-27 by Alexander I read other threads about the SIM800. I write what consumes 2.0 ampere + esp12f 0.6 ampere = 2.6 . The power supply I have a maximum of 2.5 amperes. Maybe in this case Posted at 2017-08-28 by Alexander The esp8266 has two UARTS. UART0 (Serial1) uses gpio1 for TX and gpio3 for RX and is used by the Espruino JavaScript console. It can be used for other things once the Espruino console is moved to another device. For instance calling LoopbackA.setConsole() will move the console to 'loopback' (where is can be accessed using LoopbackB), and will free up Serial1 for use like any normal Espruino Serial port. Posted at 2017-08-29 by @gfwilliams I'd definitely suggest you power SIM800 from a LiPo battery. I have never been able to get a SIM800 to work properly when just powered off USB - I think it just draws too much power. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2017-08-24 by Alexandr
I connect SIM800l in on Serial1. Connect for debugging via WIFI, everything works fine. As soon as disconnect the Web ide from the module, the module shuts down and restarts. After the reboot, the program comes to the moment of work with Serial1 and again leaves in reboot. This happens endlessly, while connecting web ide. What could be the problem?
After connecting you see this:
| |_ ___ ___ _ ||___ ___
| | -| . | _| | | | | . |
||| || |||||_|
|| http://espruino.com
1v93 Copyright 2016 G.Williams
Espruino is Open Source. Our work is supported
only by sales of official boards and donations:
http://espruino.com/Donate
Flash map 4MB:512/512, manuf 0xe0 chip 0x4016
=undefined
Erasing Flash..................
Writing...........
Compressed 25600 bytes to 8910
Checking...
Done!
Running onInit()...
connected!
192.168.99.66
point_rssi : -74 db
Disconnected
Connected
my code:
var p1 = ""; var p2 = ""; var p3 = ""; var p4 = "";
var start;
var ow;
var i = 0;
function reboot(){
print("reboot...");
ESP8266.reboot();
}
var point_rssi = 0; var ip; var mac;
var ESP8266 = require("ESP8266"),
wifi = require("Wifi");
function onInit() {
wifi.stopAP();
wifi.connect("INGRIFAB", {password: "B73vFeX6se2"}, function(err) {
if(err)console.log(err);else console.log("connected!");
console.log(wifi.getIP().ip);
ip = wifi.getIP().ip;
wifi.getStatus(function(ap) {
if(ap.station === 'connected'){
setTimeout(wifi_scan,1000);
setInterval(send_data, 3000);
setInterval(reboot, 86400000);
setInterval(reset_modem, 86400000);
reset_modem();
Serial1.setup(115200);
});
}
Pin.prototype.startFlashing = function(period,stop) {
var delay_led; var on_led;
var pin = this;
if (stop === true){clearInterval(delay_led);digitalWrite(pin, true);}else{stopon_led = false;}
if(stop === false){
delay_led = setInterval(function() {
on_led = !on_led;
digitalWrite(pin, on_led);
}, period);
}
};
function sms_send(text_sms){
D5.startFlashing(100,false);
//setTimeout(function (){D5.startFlashing(100,true);},2000);
var i=0;
var arr_comand =["AT+CMGS="+79216444654"",text_sms,"\x1A"];
var interval_init = setInterval(function(){
if(i<arr_comand.length){
Serial1.println(arr_comand[i]);
//print("comand : "+arr_comand[i]);
i++;
}
if(i == arr_comand.length){
clearInterval(interval_init);
}
}, 400);
}
function reset_modem(){
digitalWrite(D13, true);
digitalWrite(D13, false);
digitalWrite(D13, true);
}
function Start_modem(){
digitalWrite(D5, false);
var connection = setInterval(function(){ Serial1.println("AT+COPS?");},300);
Serial1.on('data', function (data) {
print(" "+data);
});
}
function list_balanse(stringOne){
var newstr = stringOne.substring(13, 49);
//print("newstr : "+newstr);
var arr = [];
var d = 0;
var result ="";
for (var i = 0; i < 24; i+=4) {
arr [d] ='0x' + newstr.substring(i, i+4);
if(parseInt(newstr.substring(i, i+2)) === 0){
result += String.fromCharCode(arr[d]);
}
}
//print("balanse : "+result);
}
function balans(){
digitalWrite(D5, false);
Serial1.println("AT+CSQ");
Serial1.println("AT+CUSD=1,"*100#"");
}
function init_modem(){
var i=0;
var arr_comand =["AT+CMGF=1","AT+IFC=1, 1","AT+CSCS="GSM""];
var interval_init = setInterval(function(){
if(i<arr_comand.length){
Serial1.println(arr_comand[i]);
//print("comand : "+arr_comand[i]);
i++;
}
if(i == arr_comand.length){
clearInterval(interval_init);
sms_send('System reboot and start');
}
}, 300);
}
function send_data(){
digitalWrite(D4, false);
//print(process.memory().free);
// if(process.memory().free < 600)ESP8266.reboot();
Beta Was this translation helpful? Give feedback.
All reactions