Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
den har
@denman0000_gitlab
@moose4621 I was thinking about all last night and looking at the original arduino code I have .. and hopefully have now broken down the steps,
Chris Dalby
@moose4621
@denman0000_gitlab Hmm, nothing jumps out at me yet.
den har
@denman0000_gitlab
@moose4621 ... The order is as follows :
1.read a file from spiffs to populate a table on Webpage as well as an array on the C++/arduino side.
  1. If a row is added grab the data from input fields and update the table .
  2. get that row info into variables and populate array
    (at same time write the array field to a file on spiffs) .
@moose4621 sorry steps are 1,2,3 lol something weird in formatting here
@moose4621 currently that code returns multiple entries in the serial console when you click save only once :-( see here :
Hours: 12
Minutes: 01
Seconds: 27
This is server arg: 12
Hours: 12
Minutes: 01
Seconds: 27
This is server arg: 12
Hours: 12
Minutes: 01
Seconds: 27
This is server arg: 12
Hours: 12
Minutes: 01
Seconds: 27
Chris Dalby
@moose4621
@denman0000_gitlab Nope, still cannot see where the problem is. Still looking.
den har
@denman0000_gitlab
@moose4621 maybe its here : $.get('/save?hh=' + hh + '&mm=' + mm + '&ss=' + ss, function(data){\
I cant quite get whats happening there
Develo
@devyte
@moose4621 sorry, I'm not much of a js guy, and for my simple needs I use basic js, not jquery or whatever. I need stand-alone apps that don't depend on externally hosted libs
If you have C/C++ questions, I can try to answer
den har
@denman0000_gitlab
@devyte Ty man much appreciated
Hi all anyone here ?
Develo
@devyte
still around
den har
@denman0000_gitlab
@devyte cool how you doing ?
Develo
@devyte
about to start another round of repo issue cleanup
how about you?
den har
@denman0000_gitlab
You're keeing busy hey :-)
I'm still trying to figure out how to put all the pieces together but starting to confuse myself
one big burning questions I have is how to make a file on spiffs available to write to from my webpage
Develo
@devyte
look at FSBrowser example
den har
@denman0000_gitlab
typically when one works with a table on a web page .. you can add and remove elements
that interaction is done with a database
OR local file ....
or a file on a local or remote server (which serves the file )
Develo
@devyte
I use something based on FSBrowserNG tied into the async webserver
den har
@denman0000_gitlab
I havelooked at the FSBrowser example.. which makes perfect sense and I have it working and can add, append to a file. ..... but how to I present that file to the client
for example : url htttp://mydatafile.txt
Develo
@devyte
there's an edit interface in there somewhere, which is essentially a text editor
I use that a lot
den har
@denman0000_gitlab
moreover getting the path to that file ... for example http://myespIP/virtual_presented_file_path/mydatafile.txt
@devyte cool i will try find that one just now
esentialluy i just want the file to act like a database
Develo
@devyte
there was an idea about integrating a micronized sqlite into the ESP at some point, but I never saw it implemented. I know there was something done in the lua firmware repo
den har
@denman0000_gitlab
damn .. would have been good .. even some in memory object that works as a broker to a file would be awesome
Develo
@devyte
why not use a json serialized to a file?
there's arduinojson as a lib
that's what I do for storing config values on SPIFFS
den har
@denman0000_gitlab
yes i was looking at that yesterday .. just not sure what format to set it up as or how to set it up
currently my table rows look like this :
motor,outside,2018-06-18 12:00,1529316000,2018-06-19 12:00,1529402400,Normal,0001,0001
Develo
@devyte
make up your own format. You can do an array of indexed elements, or a dict of named elements, or something that resembles a C struct
depends on your needs
den har
@denman0000_gitlab
I understand c struct
with json the docs refer to a key value pair
Develo
@devyte
there's key-value pair, and there's array
den har
@denman0000_gitlab
so would motor be a key or would something like device ID be a better choice
aha re array
Develo
@devyte
so you'd probably have a json array of elements, where each element is a json obj that has 9 key-value pairs
den har
@denman0000_gitlab
perhaps for indexing the key value pair might be better .. not eniterly sure
@devyte ok so you saying that maybe each row in table would be an element in the array and the values for each column are the key-value pairs ?
Develo
@devyte
look at the arduinojson examples, read their doc page, they have a ton of examples