M5Stack121 icon indicating copy to clipboard operation
M5Stack121 copied to clipboard

M5Stack121ON - QR code error

Open martinschultzkristensen opened this issue 5 years ago • 13 comments

Hey, Great project! Up and running after just half an hour. Who would have thought! :)

HOWEVER I have a bug! My QR code is getting corrupted after one or two payments:

When I try to pay it says "API error: Server fault (code 6)"

Has anyone similar problem, and potentially a solution. I'm using the opennode API.

IMG_20190927_131455

martinschultzkristensen avatar Sep 27 '19 11:09 martinschultzkristensen

exact same issue here! i experienced this same error with the M5stackSats project. it turned out to be an issue with my tls cert. we rem'd out the //client.setCACert(test_root_ca); lines and this resolved the issue. unfortunately the same tactic isnt working for this project i am not sure why. i reached out to @arcbtc to see if he has any ideas.

coinicarus avatar Oct 12 '19 23:10 coinicarus

The OP was using OpenNode, not LND so your solution wouldn't work. After one or two payments? In your code try adding to line 41:

Serial.println(data_lightning_invoice_payreq); Serial.println(payreq);

Open Serial Monitor to see what's going on with the corrupted invoices

arcbtc avatar Oct 13 '19 16:10 arcbtc

C:\Users\Phil\Documents\Arduino\M5Stack121-master\M5Stack121BLITZ\M5Stack121BLITZ.ino: In function 'void setup()':

M5Stack121BLITZ:42:18: error: 'data_lightning_invoice_payreq' was not declared in this scope

Serial.println(data_lightning_invoice_payreq);

image

since it wouldnt compile with those added lines, i removed them and started the serial monitor anyway, not sure this output will help but adding it anyways rst:0x1 (POWERON_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:1 load:0x3fff0018,len:4 load:0x3fff001c,len:1216 ho 0 tail 12 room 4 load:0x40078000,len:9720 ho 0 tail 12 room 4 load:0x40080400,len:6352 entry 0x400806b8 M5Stack initializing...OK

coinicarus avatar Oct 13 '19 21:10 coinicarus

Yo Coinicarus, you're using different code to the original post!

Your using https://github.com/arcbtc/M5Stack121/tree/master/M5Stack121BLITZ

martinschultzkristensen is using https://github.com/arcbtc/M5Stack121/tree/master/M5Stack121ON

I have also moved your question to here https://github.com/arcbtc/M5Stack121/issues/2

as it is not related to this post

arcbtc avatar Oct 14 '19 10:10 arcbtc

Yo Coinicarus, you're using different code to the original post!

Your using https://github.com/arcbtc/M5Stack121/tree/master/M5Stack121BLITZ

martinschultzkristensen is using https://github.com/arcbtc/M5Stack121/tree/master/M5Stack121ON

I have also moved your question to here #2

as it is not related to this post

woops! sorry m bro, my bad. similar issue though lol.,

coinicarus avatar Oct 14 '19 22:10 coinicarus

Now I've added it here

checkpayment(data_id); //line 41// Serial.println(data_lightning_invoice_payreq); Serial.println(payreq);
int counta = 0; while (counta < 1000){ if (data_status == "unpaid"){ delay(300); checkpayment(data_id); counta++;

I can first run it on m5stack on Saturday. (Away from home) @arcbtc Can you tell me if this is the place you meant?

martinschultzkristensen avatar Oct 15 '19 09:10 martinschultzkristensen

Line 41 from the github, like so

arcbtc avatar Oct 15 '19 16:10 arcbtc

so,

fetchpayment(); delay(100); const char *payreq = String(data_lightning_invoice_payreq).c_str(); M5.Lcd.fillScreen(BLACK); M5.Lcd.qrcode(payreq,45,0,240,10); delay(100); Serial.println(data_lightning_invoice_payreq); Serial.println(payreq); checkpayment(data_id); while (counta < 1000){ if (data_status == "unpaid"){ delay(300); checkpayment(data_id); counta++; }

arcbtc avatar Oct 15 '19 16:10 arcbtc

Thanks for specifying.

martinschultzkristensen avatar Oct 15 '19 17:10 martinschultzkristensen

The first one is displayed correctly, until paid. Then it's corrupt.

M5Stack initializing...OK {"data":{"id":"7b0ccfb9-16de-4a6f-b0ed-ce692cfff09b","name":null,"description":"danceOmatic, let's go!","created_at":1571505283,"status":"unpaid","callback_url":null,"success_url":"https://opennode.co","order_id":"N/A","notes":"","currency":"BTC","source_fiat_value":0,"fiat_value":0.0007897032,"auto_settle":false,"notif_email":null,"lightning_invoice":{"expires_at":1571508883,"payreq":"LNBC100N1PW6K3YRPP59DWDWRG3W9JY4LF9RE9UKPX7YEY48X0CUCTLXYJNDXQZMGPZFCWQDPYV3SKUCM9FAKKZARFVVKZQMR9WSNHXGR8DUSSCQZPG887UYMCH9TUWY4QEY9X5DXQN4K40F76Z42J7XCNJ4R6RKA8ZMVH9MPQWSGP9GUSUTY3VVVJXMV650Q0R0GUANY3RR2VHR6LU5CTVWTCPPFAUM8"},"chain_invoice":{"address":"3KUU9xiZyScRxyvSmH2aoSxZuNsUj2a7e9"},"address":"3KUU9xiZyScRxyvSmH2aoSxZuNsUj2a7e9","amount":10,"uri":"bitcoin:3KUU9xiZyScRxyvSmH2aoSxZuNsUj2a7e9?amount=0.00000010&label=danceOmatic, let's go!&lightning=LNBC100N1PW6K3YRPP59DWDWRG3W9JY4LF9RE9UKPX7YEY48X0CUCTLXYJNDXQZMGPZFCWQDPYV3SKUCM9FAKKZARFVVKZQMR9WSNHXGR8DUSSCQZPG887UYMCH9TUWY4QEY9X5DXQN4K40F76Z42J7XCNJ4R6RKA8ZMVH9MPQWSGP9GUSUTY3VVVJXMV650Q0R0GUANY3RR2VHR6LU5CTVWTCPPFAUM8"}} LNBC100N1PW6K3YRPP59DWDWRG3W9JY4LF9RE9UKPX7YEY48X0CUCTLXYJNDXQZMGPZFCWQDPYV3SKUCM9FAKKZARFVVKZQMR9WSNHXGR8DUSSCQZPG887UYMCH9TUWY4QEY9X5DXQN4K40F76Z42J7XCNJ4R6RKA8ZMVH9MPQWSGP9GUSUTY3VVVJXMV650Q0R0GUANY3RR2VHR6LU5CTVWTCPPFAUM8

unpaid unpaid unpaid unpaid unpaid unpaid unpaid unpaid unpaid unpaid unpaid paid {"data":{"id":"5cb73803-7663-4c3f-add2-299f43a2fcc1","name":null,"description":"danceOmatic, let's go!","created_at":1571505332,"status":"unpaid","callback_url":null,"success_url":"https://opennode.co","order_id":"N/A","notes":"","currency":"BTC","source_fiat_value":0,"fiat_value":0.000789884865,"auto_settle":false,"notif_email":null,"lightning_invoice":{"expires_at":1571508932,"payreq":"LNBC100N1PW6K395PP5U9L6AUDCMHPKQQ24UFDLPC4XHKZNK3CZPVRZ0EWRMP72PUK8EAESDPYV3SKUCM9FAKKZARFVVKZQMR9WSNHXGR8DUSSCQZPGVEAEFVU7Y3D428KKANRFD0KF4U0EDC8CCVXVMV2L0WPV09UJM3UYURDFC20SV9NUN204W2QSW33MSQG92ERHFLPPW42UGTUECF5YUUQPHP9Y67"},"chain_invoice":{"address":"3MKi7vP4zfY9YXswzjGykmVDuSYAfpnYqV"},"address":"3MKi7vP4zfY9YXswzjGykmVDuSYAfpnYqV","amount":10,"uri":"bitcoin:3MKi7vP4zfY9YXswzjGykmVDuSYAfpnYqV?amount=0.00000010&label=danceOmatic, let's go!&lightning=LNBC100N1PW6K395PP5U9L6AUDCMHPKQQ24UFDLPC4XHKZNK3CZPVRZ0EWRMP72PUK8EAESDPYV3SKUCM9FAKKZARFVVKZQMR9WSNHXGR8DUSSCQZPGVEAEFVU7Y3D428KKANRFD0KF4U0EDC8CCVXVMV2L0WPV09UJM3UYURDFC20SV9NUN204W2QSW33MSQG92ERHFLPPW42UGTUECF5YUUQPHP9Y67"}} LNBC100N1PW6K395PP5U9L6AUDCMHPKQQ24UFDLPC4XHKZNK3CZPVRZ0EWRMP72PUK8EAESDPYV3SKUCM9FAKKZARFVVKZQMR9WSNHXGR8DUSSCQZPGVEAEFVU7Y3D428KKANRFD0KF4U0EDC8CCVXVMV2L0WPV09UJM3UYURDFC20SV9NUN204W2QSW33MSQG92ERHFLPPW42UGTUECF5YUUQPHP9Y67

unpaid unpaid unpaid unpaid

Skærmbillede 2019-10-19 kl  19 17 26

martinschultzkristensen avatar Oct 19 '19 17:10 martinschultzkristensen

@arcbtc do you read anything unusual from my post? Course to me it looks the same. :/

martinschultzkristensen avatar Oct 22 '19 08:10 martinschultzkristensen

Did you manage to fix this?

arcbtc avatar Nov 08 '19 13:11 arcbtc

No unfortunately. I tried

  • to change the description from "danceOmatic, let's go!" to danceOmatic. This seemed to give me a little more working QR codes. (about 6 working before 1 corrupted)

  • to reupload the code to the M5Stack. Makes the 1st qr code work for sure.

I also tried to contact opennode, they just asked if I used the right environment. I didn't manage to respond them.

I'm not the best troubleshooter, but I'm also quite clueless as where to set in. Any suggestions?

martinschultzkristensen avatar Nov 08 '19 14:11 martinschultzkristensen