This is a follow on from my post about JSon querys and got me thinking but I need some assistance on where to look for the solution.
I have M5Stack Coreink that doesn't have the memory to directly access a full shops JSON file so I started thinking.
If I set up a Raspberry pi (just because I have one) to act as the master shop server. that does the searching and then creates small files that the coreinks can access that files.
Shop price system assistance and guidance help needed please.
Re: Shop price system assistance and guidance help needed please.
That would work, but begs the question: why not do everything on the RPi then
Manually parsing the JSON might actually still be simpler and quicker to implement, i.e. read from socket in chunks and then look for things you know (from a quick look, in this particular case it looks like all products start with id/title/handle).
Manually parsing the JSON might actually still be simpler and quicker to implement, i.e. read from socket in chunks and then look for things you know (from a quick look, in this particular case it looks like all products start with id/title/handle).
Re: Shop price system assistance and guidance help needed please.
Because the RPI team havent made a stand alone e-ink device.
Instead of downloading the whole json, I tried to download just a part of it but i kept getting syntax and unscriptable errors
Re: Shop price system assistance and guidance help needed please.
Fair enough.Because the RPI team havent made a stand alone e-ink device.
Yes because a part of the string isn't valid JSON. I.e. if the complete JSON string isI tried to download just a part of it but i kept getting syntax and unscriptable errors
Code: Select all
{"products": [{"id": "id1"}, {"id": "id2"}]}
Code: Select all
{"products": [{"id": "id1"
With 'manually parsing' I mean that you get a part of the string and then manually look for product ids etc with string operations or regex. E.g. on the string above if you do
Code: Select all
ure.match('.*\{"id": "(\w+)"', '{"products": [{"id": "id1"').group(1)
Re: Shop price system assistance and guidance help needed please.
Ahh, that explains a few things then.
This is the Prototype code for one of the GUI's
Not nearly even halfway finished yet but working on it.
This is the Prototype code for one of the GUI's
Code: Select all
from m5stack import *
from m5ui import *
from uiflow import *
setScreenColor(15)
my_50mm = None
my_100mm = None
my_200mm = None
my_500mm = None
label0 = M5TextBox(20, 27, "Text", lcd.FONT_DejaVu24, 0, rotate=0)
label1 = M5TextBox(10, 86, "Text", lcd.FONT_DejaVu24, 0, rotate=0)
image0 = M5Img(17, 152, "res/default.png", True)
label2 = M5TextBox(10, 434, "Text", lcd.FONT_DejaVu24, 0, rotate=0)
label3 = M5TextBox(10, 495, "Text", lcd.FONT_DejaVu24, 0, rotate=0)
label4 = M5TextBox(10, 553, "Text", lcd.FONT_DejaVu24, 0, rotate=0)
label5 = M5TextBox(10, 619, "Text", lcd.FONT_DejaVu24, 0, rotate=0)
label0.setFont(lcd.FONT_DejaVu40)
label1.setFont(lcd.FONT_DejaVu40)
label2.setFont(lcd.FONT_DejaVu40)
label3.setFont(lcd.FONT_DejaVu40)
label4.setFont(lcd.FONT_DejaVu40)
label5.setFont(lcd.FONT_DejaVu40)
label0.setText('15mmX15mm')
label1.setText('Aluminium Extrusion')
image0.show()
label2.setText(str((str('50mm (12pcs):') + str(my_50mm))))
label3.setText(str((str('100mm (12pcs):') + str(my_100mm))))
label4.setText(str((str('100mm (12pcs):') + str(my_200mm))))
label5.setText(str((str('100mm (12pcs):') + str(my_500mm))))
lcd.show()