ethanak / SimplePgSQL

Simple PostgreSQL connector for Arduino and ESP8266
GNU Lesser General Public License v2.1
48 stars 32 forks source link

conn.status() >> Fatal exception 9 #2

Closed ingoogni closed 6 years ago

ingoogni commented 6 years ago

On trying to connect I get either conn.status() 1 or 3 and more often immediately Fatal exception 9 Sometimes 3 first and then the exception, as in the output attached.

PG is on a win10 box. Connecting to it from a Linux wireless laptop is no problem.

The code:

#include <ESP8266WiFi.h>
#include <SimplePgSQL.h>

IPAddress PGIP(10,0,0,4);
WiFiClient client;
char buffer[1024];
PGconnection conn(&client, 0, 1024, buffer);

void setup(void){
  Serial.begin(115200);
  Serial.setDebugOutput(true);
  WiFi.begin("ijnet", "XXXXX");
  while ( WiFi.status() != WL_CONNECTED ) {
    delay (500);
    Serial.print (".");
  }

  Serial.println("\n\nConnecting to DB\n\n");

  int rc;    
  conn.setDbLogin(PGIP, "ingo","YYYYY","espdb","utf8",5432);
  rc = conn.status();
  Serial.println("conn.status: ");
  Serial.println(rc);
  while ( rc == CONNECTION_AWAITING_RESPONSE ) {
    delay (500);
    Serial.print ( "----\n" );
    rc = conn.status();
  }
  Serial.println("conn.status: ");
  Serial.println(rc);
}

void loop(){}

The output:

scandone
f 0, scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 2
cnt 

connected with ijnet, channel 2
dhcp client start...
..ip:10.0.0.3,mask:255.255.255.0,gw:10.0.0.1
.

Connecting to DB

conn.status: 
3
----
Fatal exception 9(LoadStoreAlignmentCause):
epc1=0x40202b4f, epc2=0x00000000, epc3=0x00000000, excvaddr=0x3f006239, depc=0x00000000

Exception (9):
epc1=0x40202b4f epc2=0x00000000 epc3=0x00000000 excvaddr=0x3f006239 depc=0x00000000

ctx: cont 
sp: 3ffef6f0 end: 3ffef950 offset: 01a0

>>>stack>>>
3ffef890:  00000020 00000000 a9837002 5eff8a74  
3ffef8a0:  00000000 031c5a8d 00000000 3ffe8490  
3ffef8b0:  3ffef8d4 3ffef8d4 3ffee3b0 3fff021c  
3ffef8c0:  3ffee798 3ffee798 3ffee3b0 402030f8  
3ffef8d0:  56545db8 00000005 0000000c 3ffee952  
3ffef8e0:  402010ae 000001f4 3ffee8f0 3ffe8490  
3ffef8f0:  3ffee3b0 00000003 3ffee8f0 40201cdf  
3ffef900:  00001538 feefeffe feefeffe feefeffe  
3ffef910:  3ffe8660 0400000a feefeffe feefeffe  
3ffef920:  feefeffe feefeffe feefeffe 3ffee91c  
3ffef930:  3fffdad0 00000000 3ffee914 402037c4  
3ffef940:  feefeffe feefeffe 3ffee930 40100718  
<<<stack<<<

 ets Jan  8 2013,rst cause:2, boot mode:(1,7)

 ets Jan  8 2013,rst cause:4, boot mode:(1,7)

wdt reset
ingoogni commented 6 years ago

The above more or less and the pgconsole example app work with password auth but not with md5

ethanak commented 6 years ago

It was very important information ;)

Probably corrected, please check.

ingoogni commented 6 years ago

Tested with pgconsoles. Works! Excellent. Thanks.