Add insulin/glucose readings #89
Replies: 19 comments 1 reply
-
What do you exactly do? |
Beta Was this translation helpful? Give feedback.
-
What do you exactly do?
I have added code to watchserver.cpp to accept a URL of the form:
http://192.168.0.61:17580/extras/setvalue?blood=89&fastinsulin=75&time=xxxxxxxxx
this will set BG to 89 and fast insulin to 75 at time = xxxxxxx (unix time)
What information does the bar scanner receive?
The scanner scans either the barcode or QR code on my insulin pens. I use
Lantus and Humalog. I don't know if other brands have bar codes on them.
If not, simple matter to go online generate a bar code, then print to a
sheet of
stickers, and then stick onto the pen, vial, or pill container.
Right now it only indicates an application, not the amount. In
the future might implement a feature where if you scan the barcode multiple
times
within 1 minute, take number of times and multiply by 10 to get insulin
units.
If you don't have a barcode reader, you could use stick-on NFC tags(would
need to write an app to read NFC tags)
For what do you monitor Bluetooth?
I have developed an app (written in c#) that connects and listens to
BLE enabled glucose readers(happy to share), once I get the BG reading
I update Juglucco using above URL
What do you do with finger-prick measurement?
I use the above URL to update Juggluco Linux app, I then mirror this
data to another phone running Juggluco which has the CGM data. This
phone merges the data and presents it to the user. Would be nice
not to have to run Juggluco app and update phone directly.
Yes, I am interested in the changes you made. From what version of Juggluco
is it a modification?
My best guess for version is 4.18.0 downloaded on 6/26/2023
Here are the changes I made, Insert the following in file watchserver.cpp
at approximately line 1000
(I am sure you can figure out exactly where to insert it)
It needs to be run every time the xdrip server receives a packet.
////////////////////////////////////////////////////////////////////////////////////////
std::string_view setvalue="extras/setvalue";
if(!memcmp(setvalue.data(), toget.data(), setvalue.size())) {
try {
time_t dataTime=time(NULL);
const char *end=toget.data()+setvalue.size();
if (*end=='?') {
string s = {toget.begin(), toget.end()};
int st=end-toget.data()+1;
int en = s.find(' ');
std::string* query = new std::string(s, st, en-st);
std::stringstream tStream;
std::string segment;
int iType=-1;
double dValue=-1.0;
std::string tLeft;
std::string tRight;
std::stringstream qStream;
qStream.clear();
qStream.str(query->data());
while(std::getline(qStream, segment, '&')) {
tStream.clear();
tStream.str(segment.data());
std::getline(tStream,tLeft,'=');
std::getline(tStream,tRight,'=');
if (!strcmp(tLeft.data(),"time")) {
dataTime=std::stol(tRight);
}
}
qStream.clear();
qStream.str(query->data());
while(std::getline(qStream, segment, '&')) {
tStream.clear();
tStream.str(segment.data());
std::getline(tStream,tLeft,'=');
std::getline(tStream,tRight,'=');
dValue=-1.0;
iType=-1;
if (!strcmp(tLeft.data(),"time")) {
}
else if (!strcmp(tLeft.data(),"fastinsulin")) {
iType=0; dValue = std::stold(tRight);
}
else if (!strcmp(tLeft.data(),"carbohydrate")) {
iType=1; dValue = std::stold(tRight);
}
else if (!strcmp(tLeft.data(),"dextrose")) {
iType=2; dValue = std::stold(tRight);
}
else if (!strcmp(tLeft.data(),"longinsulin")) {
iType=3; dValue = std::stold(tRight);
}
else if (!strcmp(tLeft.data(),"bike")) {
iType=4; dValue = std::stold(tRight);
}
else if (!strcmp(tLeft.data(),"walk")) {
iType=5; dValue = std::stold(tRight);
}
else if (!strcmp(tLeft.data(),"blood")) {
iType=6; dValue = std::stold(tRight);
}
else {
char *p;
int tInt=strtol(tLeft.c_str(), &p, 10);
if (*p == 0){
iType=tInt;
dValue = std::stold(tRight);
}
else {
cout<<"Could Not Find entry\n";
}
}
if (iType!=-1 && dValue!=-1.0){
cout<<"Settinmg IND: "<<iType<<" VALUE: "<<dValue<<"\n";
Numdata* kpfnumdata1=Numdata::getnumdata(
pathconcat(numbasedir,"here"),0,nummmaplen);
kpfnumdata1->numsave(dataTime, dValue, iType, 0);
}
}
return givenothing(outdata);
}
}
catch (...) {
cout<<"Exception Caught\n";
givenothing(outdata);
return false;
}
}
/////////////////////////////////////////////////////////////////////////////////////
…On Sat, Oct 21, 2023 at 5:21 AM Jaap Korthals Altes < ***@***.***> wrote:
What do you exactly do?
What information does the bar scanner receive?
For what do you monitor Bluetooth?
What do you do with finger-prick measurement?
Yes, I am interested in the changes you made. From what version of
Juggluco is it a modification?
—
Reply to this email directly, view it on GitHub
<#89 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHIRDRVI3BSIHTEKKT7LWZLYAO45JAVCNFSM6AAAAAA6KCMXH6VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TGNBWGE4DO>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
The mean problems I have with your code are the following: I have changed your code so that it can be used with arbitrary labels and makes use of numdata[0], plus some less important changes: I also made some other changes to make it work, for example I added "case toshort("20"): *uititer++=' ';break;" to rewriteperc, needed for labels with white space in them: int rewriteperc(char *start,int len) {
char *ends=start+len;
char *iter=start;
char *uititer=start,*next;
while(true) {
if((next=std::find(iter,ends,'%'))==ends) {
if(iter!=uititer) {
int left=(ends-iter);
memmove(uititer,iter,left);
return uititer+left-start;;
}
return len;
}
int bijlen=(next-iter);
memmove(uititer,iter,bijlen);
uititer+=bijlen;
++next;
switch(toshort(next)) {
case toshort("5B"): *uititer++='[';break;
case toshort("5D"): *uititer++=']';break;
case toshort("24"): *uititer++='$';break;
case toshort("3D"): *uititer++='=';break;
case toshort("20"): *uititer++=' ';break;
default: LOGGER(LOGID "strange char %.3s\n",next-1); memmove(uititer,next-1,3);uititer+=3;
}
iter=next+2;
}
}
EDIT: std::string_view setvalue="extras/setvalue";
if(!memcmp(setvalue.data(), toget.data(), setvalue.size())) {
try {
time_t dataTime=0;
const char *end=toget.data()+setvalue.size();
if (*end=='?') {
const char *start=end+1;
extern int rewriteperc(char *start,int len);
int newlen=rewriteperc(const_cast<char *>(start),toget.end()-start);
std::string_view rest(start, newlen);
auto en = rest.rfind(' ');
std::stringstream qStream({rest,0,en});
std::string segment;
while(std::getline(qStream, segment, '&')) {
std::stringstream tStream(segment);
std::string tLeft;
std::string tRight;
std::getline(tStream,tLeft,'=');
std::getline(tStream,tRight,'=');
if (!strcmp(tLeft.data(),"time")) {
dataTime=std::stol(tRight);
}
}
qStream.clear();
qStream.seekg(0,ios::beg);
while(std::getline(qStream, segment, '&')) {
std::string tLeft;
std::string tRight;
std::stringstream tStream(segment);
std::getline(tStream,tLeft,'=');
std::getline(tStream,tRight,'=');
float fValue=-1.0;
int iType=-1;
if(strcmp(tLeft.data(),"time")) {
const int labelnr=settings->getlabelcount();
LOGGERWEB("look for %s\n", tLeft.data());
if(!strcmp(tLeft.data(),"fastinsulin")) {
LOGARWEB("fast insulin");
for(int i=0;i<labelnr;++i) {
if(rapidNightWeight(i)!=0.0f ) {
iType=i;
fValue = std::stof(tRight);
break;
}
}
}
else {if (!strcmp(tLeft.data(),"carbohydrate")) {
for(int i=0;i<labelnr;++i) {
if(auto weight=carboNightWeight(i)) {
iType=i;
fValue = std::stod(tRight)/weight;
break;
}
}
}
else { if (!strcmp(tLeft.data(),"longinsulin")) {
for(int i=0;i<labelnr;++i) {
if(longNightWeight(i)!=0.0f ) {
iType=i;
fValue = std::stof(tRight);
break;
}
}
}
else {
for(int i=0;;++i) {
if(i==labelnr) {
char *p;
int tInt=strtol(tLeft.c_str(), &p, 10);
if (*p == 0){
iType=tInt;
fValue = std::stof(tRight);
}
else {
LOGGERWEB("Could Not Find entry %s\n",tLeft.c_str());
wrongpath(toget,outdata);
return false;
}
break;
}
std::string_view typestr=settings->getlabel(i);
if(!memcmp(tLeft.data(),typestr.data(),typestr.size())) {
iType=i;
fValue=std::stof(tRight);
break;
}
}
}
}
}
if (iType!=-1 && fValue!=-1.0){
LOGGERWEB("Setting IND: %s (%d) VALUE: %f\n",tLeft.c_str(),iType, fValue);
// Numdata* kpfnumdata1=Numdata::getnumdata( pathconcat(numbasedir,"here"),0,nummmaplen);
Numdata* kpfnumdata1=numdatas[0];
if(!dataTime)
dataTime=time(nullptr);
kpfnumdata1->numsave(dataTime, fValue, iType, 0);
}
}
}
}
return givenothing(outdata);
}
catch (...) {
LOGARWEB("Exception Caught");
givenothing(outdata);
return false;
}
}
|
Beta Was this translation helpful? Give feedback.
-
This functionality is exactly what I'm looking for. But I don't understand the details. Has this been incorporated in the official Juggluco version? Does it work with the Android version? Where do I find the IP address I have to use? I would like to automatically send insulin injections with units to Juggluco from Tasker on my phone. |
Beta Was this translation helpful? Give feedback.
-
I can't get any further. I would like to send the longinsulin via Url or via Tasker |
Beta Was this translation helpful? Give feedback.
-
Currently you can't add insulin in any other way as entering it in Juggluco or Kerfstok by hand or scanning a NovoPen. The above code isn't put in Juggluco. |
Beta Was this translation helpful? Give feedback.
-
I have done what you want to do.
To do this requires knowledge of linux software development (gcc, make, c,
c++) and
knowledge of HTTP.
If you have the knowledge/experience neccessary, here is an overview of
what you need to do (from memory, been a while)
1) Setup a Linux Machine (I used Debian), Install tools (gcc, etc.)
2) Download command line version of juggluco (
https://www.juggluco.nl/Juggluco/cmdline/index.html)
3) make sure you can compile it.
4) patch the file "watchserver.cpp", Using the code posted in the original
emails
5) Set the linux machine to mirror it's "amounts" to your android phone
6) Set your Android phone to accept "amounts" from your linux machine.
7) Run command line version on linux box.
8) Send HTTP get command to Linux box (
http://linux:17580/extras/setvalue?longinsulin=26&time=1733928338)
This is a very broad overview from memory, I have left out a lot of
details. If you think you can do this, I
can probably answer any questions.
Good Luck.
…On Wed, Dec 11, 2024 at 7:37 AM Martin11180 ***@***.***> wrote:
I can't get any further. I would like to send the longinsulin via Url or
via Tasker
that I don't have to enter it every day
I have now tried the following URL
Cell phone ip :17580/extras/setvalue?longinsulin=26&time=1733928338
Unfortunately the message Bad Request appears:
extras/setvalue?longinsulin=26&time=1733928338
The web server runs in the app
Am I missing something or data?
Greetings
Martin
—
Reply to this email directly, view it on GitHub
<#89 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHIRDRVXFM4QRB7RNSGCNND2FBL35AVCNFSM6AAAAABSE2JQTSVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCNJTGQ3TCOA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Hello ` |
Beta Was this translation helpful? Give feedback.
-
Can't help you with the compiler errors??
In watchserver.cpp there is a routine called "watchcommands(char *inbuf
...)", add it in there.
In watchcommands, there are lines like this:
if(!memcmp(sgv.data(),toget.data(),sgv.size())) {
return
sgvinterpret(toget.data()+sgv.size(),toget.size()-sgv.siz
}
Add The code before or after these three lines.
My version of code these are at line 1780
…On Wed, Dec 11, 2024 at 1:31 PM Martin11180 ***@***.***> wrote:
Hello
I tried it on a Raspberry with Ubuntu, unfortunately I got the make
juggluco command
`
/home/pi/Juggluco/Common/src/main/cpp/curve/jugglucotext.hpp:96:18: error:
member ‘std::string_view jugglucotext::::::Undetermined’ with constructor
not allowed in anonymous aggregate
96 | std::string_view Undetermined, FallingQuickly,Falling, Stable,
Rising, RisingQuickly;
| ^~~~~~~~~~~~
/home/pi/Juggluco/Common/src/main/cpp/curve/jugglucotext.hpp:96:32: error:
member ‘std::string_view jugglucotext::::::FallingQuickly’ with constructor
not allowed in anonymous aggregate
96 | std::string_view Undetermined, FallingQuickly,Falling, Stable,
Rising, RisingQuickly;
| ^~~~~~~~~~~~~~
/home/pi/Juggluco/Common/src/main/cpp/curve/jugglucotext.hpp:96:47: error:
member ‘std::string_view jugglucotext::::::Falling’ with constructor not
allowed in anonymous aggregate
96 | std::string_view Undetermined, FallingQuickly,Falling, Stable,
Rising, RisingQuickly;
| ^~~~~~~
/home/pi/Juggluco/Common/src/main/cpp/curve/jugglucotext.hpp:96:56: error:
member ‘std::string_view jugglucotext::::::Stable’ with constructor not
allowed in anonymous aggregate
96 | std::string_view Undetermined, FallingQuickly,Falling, Stable,
Rising, RisingQuickly;
| ^~~~~~
/home/pi/Juggluco/Common/src/main/cpp/curve/jugglucotext.hpp:96:64: error:
member ‘std::string_view jugglucotext::::::Rising’ with constructor not
allowed in anonymous aggregate
96 | std::string_view Undetermined, FallingQuickly,Falling, Stable,
Rising, RisingQuickly;
| ^~~~~~
/home/pi/Juggluco/Common/src/main/cpp/curve/jugglucotext.hpp:96:72: error:
member ‘std::string_view jugglucotext::::::RisingQuickly’ with constructor
not allowed in anonymous aggregate
96 | std::string_view Undetermined, FallingQuickly,Falling, Stable,
Rising, RisingQuickly;
| ^~~~~~~~~~~~~
/home/pi/Juggluco/Common/src/main/cpp/net/getcommand.cpp:693:13: warning:
‘bool startedreceiving()’ defined but not used [-Wunused-function]
693 | static bool startedreceiving() {
| ^~~~~~~~~~~~~~~~
cc1plus: note: unrecognized command-line option ‘-Wno-vla-cxx-extension’
may have been intended to silence earlier diagnostics
make[3]: *** [CMakeFiles/juggluco.dir/build.make:345:
CMakeFiles/juggluco.dir/net/getcommand.cpp.o] Error 1
make[3]: Leaving directory '/home/pi/juggluco-server'
make[2]: *** [CMakeFiles/Makefile2:146: CMakeFiles/juggluco.dir/all] Error
2
make[2]: Leaving directory '/home/pi/juggluco-server'
make[1]: *** [CMakeFiles/Makefile2:153: CMakeFiles/juggluco.dir/rule]
Error 2
make[1]: Leaving directory '/home/pi/juggluco-server'
make: *** [Makefile:153: juggluco] Error 2
`
Where does the code from above have to be inserted in the watchserver.cpp
—
Reply to this email directly, view it on GitHub
<#89 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHIRDRXX6VXOAKW6EQHQTFL2FCVL3AVCNFSM6AAAAABSE2JQTSVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCNJTG44DQNY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I have now taken the previous version of Juggluco 7.6.5 and compiling works Raspberry cell phone |
Beta Was this translation helpful? Give feedback.
-
These commands worked for me
./juggluco -c
./juggluco -a -t+ -n -X+ 192.168.248.10
./juggluco -l
Getting mirror to work on Juggluco can be tricky, a lot of options, keep on
trying different options
…On Thu, Dec 12, 2024 at 4:12 AM Martin11180 ***@***.***> wrote:
I have now taken the previous version of Juggluco 7.6.5 and compiling works
But I can't get any further now
I have now made the following settings
Raspberry
ip end: 40
./juggluco -c
./juggluco -p 8190
./juggluco -riP -L samsung21 -w 123
./juggluco
cell phone
IP end 126
Password = 123
Test label = samsung21
Received from on
Active on only
Ip = raspberry
Port = 8190
I then call the url in firefox
http://...40:17580/extras/setvalue?longinsulin=26&time=173392833
but there is no connection
—
Reply to this email directly, view it on GitHub
<#89 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHIRDRRNCLIQAAHB2VLNFND2FF4TLAVCNFSM6AAAAABSE2JQTSVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCNJUGM3TEOI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Hello |
Beta Was this translation helpful? Give feedback.
-
no, sorry, I stopped doing this a long time ago, and have gotten rid of
192.168.244.10
bassically (if i remember right) I disabled "check ip", and "check
hostname", other than
that just defaults
…On Thu, Dec 12, 2024 at 9:28 AM Martin11180 ***@***.***> wrote:
Hello
Doesn't work for me, I think there's still an error somewhere
Can you take a screenshot of the clone setting of handy and ./juggluco -l
Which device's IP is 192.168.248.10
—
Reply to this email directly, view it on GitHub
<#89 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHIRDRQRG6KUV6YZP2KI44L2FHBULAVCNFSM6AAAAABSE2JQTSVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCNJUG4ZDCNA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I dont know what units for glucose you are using, but for me I use glucose
ranging form 50-200,
maybe try longinsulin=170? or something within the glucose range?
Also try it without the time=xx parameter in the query
…On Thu, Dec 12, 2024 at 4:12 AM Martin11180 ***@***.***> wrote:
I have now taken the previous version of Juggluco 7.6.5 and compiling works
But I can't get any further now
I have now made the following settings
Raspberry
ip end: 40
./juggluco -c
./juggluco -p 8190
./juggluco -riP -L samsung21 -w 123
./juggluco
cell phone
IP end 126
Password = 123
Test label = samsung21
Received from on
Active on only
Ip = raspberry
Port = 8190
I then call the url in firefox
http://...40:17580/extras/setvalue?longinsulin=26&time=173392833
but there is no connection
—
Reply to this email directly, view it on GitHub
<#89 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHIRDRRNCLIQAAHB2VLNFND2FF4TLAVCNFSM6AAAAABSE2JQTSVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCNJUGM3TEOI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I'm one step further: I have to kill the port manually before starting ./juggluco the code is correct
|
Beta Was this translation helpful? Give feedback.
-
There is a mistake in my approach wget https://www.juggluco.nl/Juggluco/cmdline/download/juggluco-server9.0.0.src.tar.xz
to
cd juggluco-server npx kill-port 17580 && npx kill-port 8190 |
Beta Was this translation helpful? Give feedback.
-
You need to isolate problem, heres what I would do:
1) Add printf statements to above code to make sure
"kpfnumdata1->numsave(dataTime,
fValue, iType, 0);"
is being executed
2) Use the commands at "https://www.juggluco.nl/Juggluco/webserver.html" to
make sure data is accepted at RPI
3) write a simple web server on your phone on a port > 1024, and make sure
your RPI can access it
4) write a simple web server on your RPI on a port > 1024, and make sure
your phone can access it
5) Use tcpdump to see if there is activity on port 8190
6) Use the commands at "https://www.juggluco.nl/Juggluco/webserver.html" to
make sure data is accepted at phone
7) Get a second phone, and setup a mirror with first (this is only to get a
"feel" for mirroring)
If all the above works, I would be out of answers.
…On Fri, Dec 13, 2024 at 2:50 AM Martin11180 ***@***.***> wrote:
There is a mistake in my approach
wget
https://www.juggluco.nl/Juggluco/cmdline/download/juggluco-server9.0.0.src.tar.xz
tar -xf juggluco-server9.0.0.src.tar.xz
git clone -b 'v7.6.5' --single-branch
https://github.com/j-kaltes/Juggluco.git
sudo nano
/home/pi/Juggluco/Common/src/main/cpp/net/watchserver/watchserver.cpp
replace code
std::string_view sgv="sgv.json";
if(!memcmp(sgv.data(),toget.data(),sgv.size())) {
return sgvinterpret(toget.data()+sgv.size(),toget.size()-sgv.size(),behead,false,origin,outdata,false);
}
to
std::string_view setvalue="extras/setvalue";
if(!memcmp(setvalue.data(), toget.data(), setvalue.size())) {
try {
time_t dataTime=0;
const char *end=toget.data()+setvalue.size();
if (*end=='?') {
const char *start=end+1;
extern int rewriteperc(char *start,int len);
int newlen=rewriteperc(const_cast<char *>(start),toget.end()-start);
std::string_view rest(start, newlen);
auto en = rest.rfind(' ');
std::stringstream qStream({rest,0,en});
std::string segment;
while(std::getline(qStream, segment, '&')) {
std::stringstream tStream(segment);
std::string tLeft;
std::string tRight;
std::getline(tStream,tLeft,'=');
std::getline(tStream,tRight,'=');
if (!strcmp(tLeft.data(),"time")) {
dataTime=std::stol(tRight);
}
}
qStream.clear();
qStream.seekg(0,ios::beg);
while(std::getline(qStream, segment, '&')) {
std::string tLeft;
std::string tRight;
std::stringstream tStream(segment);
std::getline(tStream,tLeft,'=');
std::getline(tStream,tRight,'=');
float fValue=-1.0;
int iType=-1;
if(strcmp(tLeft.data(),"time")) {
const int labelnr=settings->getlabelcount();
LOGGERWEB("look for %s\n", tLeft.data());
if(!strcmp(tLeft.data(),"fastinsulin")) {
LOGARWEB("fast insulin");
for(int i=0;i<labelnr;++i) {
if(rapidNightWeight(i)!=0.0f ) {
iType=i;
fValue = std::stof(tRight);
break;
}
}
}
else {if (!strcmp(tLeft.data(),"carbohydrate")) {
for(int i=0;i<labelnr;++i) {
if(auto weight=carboNightWeight(i)) {
iType=i;
fValue = std::stod(tRight)/weight;
break;
}
}
}
else { if (!strcmp(tLeft.data(),"longinsulin")) {
for(int i=0;i<labelnr;++i) {
if(longNightWeight(i)!=0.0f ) {
iType=i;
fValue = std::stof(tRight);
break;
}
}
}
else {
for(int i=0;;++i) {
if(i==labelnr) {
char *p;
int tInt=strtol(tLeft.c_str(), &p, 10);
if (*p == 0){
iType=tInt;
fValue = std::stof(tRight);
}
else {
LOGGERWEB("Could Not Find entry %s\n",tLeft.c_str());
wrongpath(toget,outdata);
return false;
}
break;
}
std::string_view typestr=settings->getlabel(i);
if(!memcmp(tLeft.data(),typestr.data(),typestr.size())) {
iType=i;
fValue=std::stof(tRight);
break;
}
}
}
}
}
if (iType!=-1 && fValue!=-1.0){
LOGGERWEB("Setting IND: %s (%d) VALUE: %f\n",tLeft.c_str(),iType, fValue);
// Numdata* kpfnumdata1=Numdata::getnumdata( pathconcat(numbasedir,"here"),0,nummmaplen);
Numdata* kpfnumdata1=numdatas[0];
if(!dataTime)
dataTime=time(nullptr);
kpfnumdata1->numsave(dataTime, fValue, iType, 0);
}
}
}
}
return givenothing(outdata);
}
catch (...) {
LOGARWEB("Exception Caught");
givenothing(outdata);
return false;
}
}
std::string_view sgv="sgv.json";
if(!memcmp(sgv.data(),toget.data(),sgv.size())) {
return sgvinterpret(toget.data()+sgv.size(),toget.size()-sgv.size(),behead,false,origin,outdata,false);
}
cd juggluco-server
cmake /home/pi/Juggluco/Common/src/main/cpp
make juggluco
npx kill-port 17580 && npx kill-port 8190
./juggluco -c
./juggluco -a -t+ -n -X+ ip handy
./juggluco -l
./juggluco
firefox
http://linux:17580/extras/setvalue?fastinsulin=75&time=1734031668
return {}
—
Reply to this email directly, view it on GitHub
<#89 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHIRDRROHQX6YX3SWER4J4D2FK3WRAVCNFSM6AAAAABSE2JQTSVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCNJVGUZDGMY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
./juggluco -c Mirror port 8190 Mirror port 8190 nfc scan pen printf and debugging are not my friend and inserted under each line with LOGGERWEB prinf if (*end=='?') { remove and end } because no return came after that printf("Setting IND: %s (%d) VALUE: %f\n",tLeft.c_str(),iType, fValue); edit there are problems with these two if if (*end=='?') { and if (iType!=-1 && fValue!=-1.0){ I commented it out and it works http://rasberry:17580/extras/setvalue?longinsulin=26&time=1734118236 By the way, I tried again with the current version of juggluco with make juggluco -i and now I get this message |
Beta Was this translation helpful? Give feedback.
-
at first glance, it looks like you are mirroring the wrong way
you did:
nfc scan pen
http://raspberry:17580/x/amounts
0 113 1734094615 2024-12-13-13:56:55 1 5 nova kurz
0 114 1734107257 2024-12-13-17:27:37 1 4 nova kurz
And got insulin data that was scanned on the phone?(is this correct)
Raspberry doesn't have nfc?
I think you are mirroring: phone => raspberry
You want: raspberry => phone
…On Fri, Dec 13, 2024 at 10:03 AM Martin11180 ***@***.***> wrote:
./juggluco -c
./juggluco -p 8190
./juggluco -riP -L samsung21 -w 123
./juggluco -X
./juggluco -l
Saving in directory jugglucodata
eXport web server turned on (port 17580)
can also be used remotely over http
Do not use SSL
api/v1/treatments turned off
No api_secret
Mirror port 8190
unit: mg/dL
connection:
1: samsung21 don't test IP, receiver passiveonly 123
firefox
http://raspberry:17580/x/stream?header&mg/dL
return
Sensorid nr UnixTime YYYY-mm-dd-HH:MM:SS TZ Min mg/dL Rate ChangeLabel
XXxxxxxx 987 1734089798 2024-12-13-12:36:38 1 986 116 -0.26 STABLE
./juggluco stop
edit watchserver.cpp add code
make clean
make juggluco
npx kill-port 17580 && npx kill-port 8190
./juggluco -c
./juggluco -p 8190
./juggluco -riP -L samsung21 -w 123
./juggluco -X
./juggluco -l
Saving in directory jugglucodata
eXport web server turned on (port 17580)
can also be used remotely over http
Do not use SSL
api/v1/treatments turned off
No api_secret
Mirror port 8190
unit: mg/dL
connection:
1: samsung21 don't test IP, receiver passiveonly 123
firefox
http://raspberry:17580/x/stream?header&mg/dL
return
Sensorid nr UnixTime YYYY-mm-dd-HH:MM:SS TZ Min mg/dL Rate ChangeLabel
XXxxxxxx 987 1734089798 2024-12-13-12:36:38 1 986 116 -0.26 STABLE
nfc scan pen
http://raspberry:17580/x/amounts
0 113 1734094615 2024-12-13-13:56:55 1 5 nova kurz
0 114 1734107257 2024-12-13-17:27:37 1 4 nova kurz
edit watchserver.cpp replace
std::string_view setvalue="extras/setvalue";
if(!memcmp(setvalue.data(),toget.data(),setvalue.size())) {
return givedripstatus(origin,outdata);
}
make clean
make juggluco
npx kill-port 17580 && npx kill-port 8190
./juggluco -c
./juggluco -p 8190
./juggluco -riP -L samsung21 -w 123
./juggluco -X
./juggluco -l
./juggluco
http://raspberry:17580/extras/setvalue?longinsulin=26&time=1733928338
return data status
printf and debugging are not my friend
Can you insert the lines into your code so I can test
Data from cell phone arrives
—
Reply to this email directly, view it on GitHub
<#89 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHIRDRROQYVWXHGX7VDUEUT2FMOQHAVCNFSM6AAAAABSE2JQTSVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCNJWGA2DENI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I have modified the internal xdrip web server in juggluco
to accept new "values" The values include fast insulin, long insulin
and glucose readings(from a meter)
I use it as follows:
I have bar code scanner, and I scan my insulin pens when I take an injection, and update
juggluco. I monitor Bluetooth messages, and when I take a finger-prick measurement, I update
Juggluco
If there is any interest, I can post the changes I made to the linux version of Juggluco
Beta Was this translation helpful? Give feedback.
All reactions