M5Stack121
M5Stack121 copied to clipboard
M5Stack121ON - QR code error
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.
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.
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

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);
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
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
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.,
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?
Line 41 from the github, like so

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++; }
Thanks for specifying.
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
@arcbtc do you read anything unusual from my post? Course to me it looks the same. :/
Did you manage to fix this?
No unfortunately. I tried
-
to change the description from
"danceOmatic, let's go!"
todanceOmatic
. 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?