I'd need some help with the writing of an XML file for an experiment in which two arduino send accelerometer data to the phyphox app.
I am completely new to XML languange so any hel will be appreciated.
I am using the experiment editor of phyphox. I'll try to explain what I've done and what I am missing.
-In the Main window of the editor I've just added the title of the experiment
-In the input window I've added two bluetooth modules.
Identification: set to right and left, respectively. I'll move the sensors with my right and left hands
Device names: right_ARD and left_ARD. I will set the same device names when uploading the codes on the two sensors.
Service UUID: I've left this blank. To connect the sensors to the app is it sufficient the Device Name or do I need this information as well?
Mode: Poll. I need the sensors to send data continuously at a sampling rate of 100 Hz (which I put in the following box). is the correct?
I've checked the Subscribe on start boce as i want to start the experiment manually from the app
Config: I cannot understand if I have to change something in this case
Output: From what I understood I should add three outputs, one for each axis of the accelerometer. After this I don't know what should I do. Which of these boxes are mandatory to be filled? I can imagine that as Conversion function I should use some from the Float option as it is the format of the variables that I will use to read the accelerometer data on the arduino (as in the random number experiment for BLE). In the characteristic boxes shoul I put the name of the variables that I will use on the arduino code to store the data?
-I didn't consider the Output window as i don't need the app to send data to the sensors
-Views
I've added two views with three graphs each, one for each component of the accelerometer data.
I've just change some labels of the graphs and the x y axes
-Analysis
I've just created empty buffers and connected them to the graphs.
This is what I managed to do.
I'll post the code here
What are you using on the Arduino side: phyphoxBLE? I would likely use our library for both microcontrollers and merge the two generated experiments into one by a text editor.
On first sight, both BLE characteristics write into the same buffer, accordingly you have two identical graphs. I assume that is not intended…
Answers to some of your questions:
the UUID is (mainly) a generic identifier for heart rate monitors, HID services etc.,
“notification” mode lets the microcontroller set the rate, we mainly use this ourselves,
phyphox does not record data before tapping start, so likely no subscribeOnStart required
conversion indicates to phyphox how the data is transmitted, float or integer requires the lowest amount of data (again: phyphoxBLE would take care of that and you could look into the generated experiment)
(09-15-2023, 03:45 PM)Jens Noritzsch Wrote: What are you using on the Arduino side: phyphoxBLE? I would likely use our library for both microcontrollers and merge the two generated experiments into one by a text editor.
On first sight, both BLE characteristics write into the same buffer, accordingly you have two identical graphs. I assume that is not intended…
Answers to some of your questions:
the UUID is (mainly) a generic identifier for heart rate monitors, HID services etc.,
“notification” mode lets the microcontroller set the rate, we mainly use this ourselves,
phyphox does not record data before tapping start, so likely no subscribeOnStart required
conversion indicates to phyphox how the data is transmitted, float or integer requires the lowest amount of data (again: phyphoxBLE would take care of that and you could look into the generated experiment)
I've tried the solution you suggested but I couldn't upload the sketch on the board as it gives my error.
This is the sketch I've written following the example that I found on github "CreateExperiment"
GetACC_From_ARDUINO.setTitle("get_acc");
GetACC_From_ARDUINO.setCategory("Arduino Experiments");
GetACC_From_ARDUINO.setDescription("Random numbers are generated on Arduino and visualized with phyphox afterwards");
//View
PhyphoxBleExperiment::View firstView;
firstView.setLabel("FirstView"); //Create a "view"
//PhyphoxBleExperiment::View secondView;
//secondView.setLabel("SecondView"); //Create a "view"
//Graph
PhyphoxBleExperiment::Graph firstGraph; //Create graph which will plot random numbers over time
firstGraph.setMinY(0, LAYOUT_FIXED);
firstGraph.setMaxY(1000, LAYOUT_FIXED);
firstGraph.setLabel("Acceleration");
firstGraph.setUnitX("s");
firstGraph.setUnitY("m/s^2");
firstGraph.setLabelX("time");
firstGraph.setLabelY("Acc");
firstGraph.setXPrecision(1); //The amount of digits shown after the decimal point
firstGraph.setYPrecision(1);
/* Assign Channels, so which data is plotted on x or y axis
first parameter represents x-axis, second y-axis
Channel 0 means a timestamp is created after the BLE package arrives in phyphox
Channel 1 to N corresponding to the N-parameter which is written in server.write()
*/
firstGraph.setChannel(0, 1);
//Second Graph
PhyphoxBleExperiment::Graph secondGraph; //Create graph which will plot random numbers over time
secondGraph.setMinY(0, LAYOUT_FIXED);
secondGraph.setMaxY(1000, LAYOUT_FIXED);
secondGraph.setLabel("Acceleration");
secondGraph.setUnitX("s");
secondGraph.setUnitY("m/s^2");
secondGraph.setLabelX("time");
secondGraph.setLabelY("Acc");
secondGraph.setXPrecision(1); //The amount of digits shown after the decimal point
secondGraph.setYPrecision(1);
/* Assign Channels, so which data is plotted on x or y axis
first parameter represents x-axis, second y-axis
Channel 0 means a timestamp is created after the BLE package arrives in phyphox
Channel 1 to N corresponding to the N-parameter which is written in server.write()
*/
secondGraph.setChannel(0, 2);
//Third Graph
PhyphoxBleExperiment::Graph thirdGraph; //Create graph which will plot random numbers over time
thirdGraph.setMinY(0, LAYOUT_FIXED);
thirdGraph.setMaxY(1000, LAYOUT_FIXED);
thirdGraph.setLabel("Acceleration");
thirdGraph.setUnitX("s");
thirdGraph.setUnitY("m/s^2");
thirdGraph.setLabelX("time");
thirdGraph.setLabelY("Acc");
thirdGraph.setXPrecision(1); //The amount of digits shown after the decimal point
thirdGraph.setYPrecision(1);
/* Assign Channels, so which data is plotted on x or y axis
first parameter represents x-axis, second y-axis
Channel 0 means a timestamp is created after the BLE package arrives in phyphox
Channel 1 to N corresponding to the N-parameter which is written in server.write()
*/
thirdGraph.setChannel(0, 3);
//Info
//PhyphoxBleExperiment::InfoField myInfo; //Creates an info-box.
//myInfo.setInfo("This is an Info field!");
//myInfo.setColor("890128"); //Sets font color. Uses a 6 digit hexadecimal value in "quotation marks".
//myInfo.setXMLAttribute("size=\"1.2\"");
//Separator
//PhyphoxBleExperiment::Separator mySeparator; //Creates a line to separate elements.
//mySeparator.setHeight(0.3); //Sets height of the separator.
//mySeparator.setColor("404040"); //Sets color of the separator. Uses a 6 digit hexadecimal value in "quotation marks".
//Value
//PhyphoxBleExperiment::Value myValue; //Creates a value-box.
//myValue.setLabel("Number"); //Sets the label
//myValue.setPrecision(2); //The amount of digits shown after the decimal point.
//myValue.setUnit("unit"); //The physical unit associated with the displayed value.
//myValue.setColor("FFFFFF"); //Sets font color. Uses a 6 digit hexadecimal value in "quotation marks".
//myValue.setChannel(0);
//myValue.setXMLAttribute("size=\"2\"");
//Export
PhyphoxBleExperiment::ExportSet mySet; //Provides exporting the data to excel etc.
mySet.setLabel("mySet");
PhyphoxBleExperiment::ExportData myData1;
myData1.setLabel("myData1");
myData1.setDatachannel(1);
firstView.addElement(firstGraph); //attach graph to view
firstView.addElement(secondGraph); //attach second graph to view
firstView.addElement(thirdGraph); //attach second graph to view
//secondView.addElement(myInfo); //attach info to view
//secondView.addElement(mySeparator); //attach separator to view
//secondView.addElement(myValue); //attach value to view
GetACC_From_ARDUINO.addView(firstView); //attach view to experiment
mySet.addElement(myData1); //attach data to exportSet
mySet.addElement(myData2); //attach data to exportSet
mySet.addElement(myData3); //attach data to exportSet
GetACC_From_ARDUINO.addExportSet(mySet); //attach exportSet to experiment
PhyphoxBLE::addExperiment(GetACC_From_ARDUINO); //attach experiment to server
}
void loop()
{
float x, y, z;
IMU.readAcceleration(x, y, z);
/* The random number is written into Channel 1
Up to 5 Channels can written at the same time with server.write(randomDistance, valueChannel2, valueChannel3.. )
*/
PhyphoxBLE::write(x,y,z);
delay(50);
PhyphoxBLE::poll(); //Only required for the Arduino Nano 33 IoT, but it does no harm for other boards.
}
when I try to upload the sketch I get this error
Code:
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\errorhandler.cpp: In member function 'virtual PhyphoxBleExperiment::Error PhyphoxBleExperiment::Errorhandler::err_checkLength(const char*, int, const char*)':
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\errorhandler.cpp:8:55: error: 'string' is not a member of 'std'
copyToMem(&ret.MESSAGE, ("ERR_01, in " + std::string(origin) + "(). \n").c_str());
^~~~~~
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\errorhandler.cpp:8:55: note: suggested alternative: 'trunc'
copyToMem(&ret.MESSAGE, ("ERR_01, in " + std::string(origin) + "(). \n").c_str());
^~~~~~
trunc
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\errorhandler.cpp: In member function 'virtual PhyphoxBleExperiment::Error PhyphoxBleExperiment::Errorhandler::err_checkUpper(int, int, const char*)':
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\errorhandler.cpp:16:55: error: 'string' is not a member of 'std'
copyToMem(&ret.MESSAGE, ("ERR_02, in " + std::string(origin) + "(). \n").c_str());
^~~~~~
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\errorhandler.cpp:16:55: note: suggested alternative: 'trunc'
copyToMem(&ret.MESSAGE, ("ERR_02, in " + std::string(origin) + "(). \n").c_str());
^~~~~~
trunc
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\errorhandler.cpp: In member function 'virtual PhyphoxBleExperiment::Error PhyphoxBleExperiment::Errorhandler::err_checkHex(const char*, const char*)':
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\errorhandler.cpp:24:55: error: 'string' is not a member of 'std'
copyToMem(&ret.MESSAGE, ("ERR_03, in " + std::string(origin) + "(). \n").c_str());
^~~~~~
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\errorhandler.cpp:24:55: note: suggested alternative: 'trunc'
copyToMem(&ret.MESSAGE, ("ERR_03, in " + std::string(origin) + "(). \n").c_str());
^~~~~~
trunc
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\errorhandler.cpp:28:59: error: 'string' is not a member of 'std'
copyToMem(&ret.MESSAGE, ("ERR_03, in " + std::string(origin) + "(). \n").c_str());
^~~~~~
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\errorhandler.cpp:28:59: note: suggested alternative: 'trunc'
copyToMem(&ret.MESSAGE, ("ERR_03, in " + std::string(origin) + "(). \n").c_str());
^~~~~~
trunc
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\errorhandler.cpp: In member function 'virtual PhyphoxBleExperiment::Error PhyphoxBleExperiment::Errorhandler::err_checkStyle(const char*, const char*)':
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\errorhandler.cpp:37:55: error: 'string' is not a member of 'std'
copyToMem(&ret.MESSAGE, ("ERR_04, in " + std::string(origin) + "(). \n").c_str());
^~~~~~
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\errorhandler.cpp:37:55: note: suggested alternative: 'trunc'
copyToMem(&ret.MESSAGE, ("ERR_04, in " + std::string(origin) + "(). \n").c_str());
^~~~~~
trunc
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\errorhandler.cpp: In member function 'virtual PhyphoxBleExperiment::Error PhyphoxBleExperiment::Errorhandler::err_checkLayout(const char*, const char*)':
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\errorhandler.cpp:44:51: error: 'string' is not a member of 'std'
copyToMem(&ret.MESSAGE, ("ERR_05, in " + std::string(origin) + "(). \n").c_str());
^~~~~~
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\errorhandler.cpp:44:51: note: suggested alternative: 'trunc'
copyToMem(&ret.MESSAGE, ("ERR_05, in " + std::string(origin) + "(). \n").c_str());
^~~~~~
trunc
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\errorhandler.cpp: In member function 'virtual PhyphoxBleExperiment::Error PhyphoxBleExperiment::Errorhandler::err_checkSensor(const char*, const char*)':
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\errorhandler.cpp:51:55: error: 'string' is not a member of 'std'
copyToMem(&ret.MESSAGE, ("ERR_04, in " + std::string(origin) + "(). \n").c_str());
^~~~~~
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\errorhandler.cpp:51:55: note: suggested alternative: 'trunc'
copyToMem(&ret.MESSAGE, ("ERR_04, in " + std::string(origin) + "(). \n").c_str());
^~~~~~
trunc
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\errorhandler.cpp: In member function 'virtual PhyphoxBleExperiment::Error PhyphoxBleExperiment::Errorhandler::err_checkComponent(const char*, const char*)':
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\errorhandler.cpp:59:55: error: 'string' is not a member of 'std'
copyToMem(&ret.MESSAGE, ("ERR_04, in " + std::string(origin) + "(). \n").c_str());
^~~~~~
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\errorhandler.cpp:59:55: note: suggested alternative: 'trunc'
copyToMem(&ret.MESSAGE, ("ERR_04, in " + std::string(origin) + "(). \n").c_str());
^~~~~~
trunc
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\element.cpp: In member function 'virtual void PhyphoxBleExperiment::Element::setLabel(const char*)':
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\element.cpp:6:26: error: 'string' is not a member of 'std'
copyToMem(&LABEL, (std::string(l)).c_str());
^~~~~~
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\element.cpp:6:26: note: suggested alternative: 'trunc'
copyToMem(&LABEL, (std::string(l)).c_str());
^~~~~~
trunc
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\edit.cpp: In member function 'void PhyphoxBleExperiment::Edit::setUnit(const char*)':
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\edit.cpp:7:28: error: 'string' is not a member of 'std'
copyToMem(&UNIT, (std::string(u)).c_str());
^~~~~~
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\edit.cpp:7:28: note: suggested alternative: 'trunc'
copyToMem(&UNIT, (std::string(u)).c_str());
^~~~~~
trunc
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\edit.cpp: In member function 'void PhyphoxBleExperiment::Edit::setXMLAttribute(const char*)':
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\edit.cpp:24:39: error: 'string' is not a member of 'std'
copyToMem(&XMLAttribute, (" " + std::string(xml)).c_str());
^~~~~~
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\edit.cpp:24:39: note: suggested alternative: 'trunc'
copyToMem(&XMLAttribute, (" " + std::string(xml)).c_str());
^~~~~~
trunc
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\exportSet.cpp: In member function 'void PhyphoxBleExperiment::ExportSet::setLabel(const char*)':
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\exportSet.cpp:16:39: error: 'string' is not a member of 'std'
copyToMem(&LABEL, (" name=\"" + std::string(l) + "\"").c_str());
^~~~~~
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\exportSet.cpp:16:39: note: suggested alternative: 'trunc'
copyToMem(&LABEL, (" name=\"" + std::string(l) + "\"").c_str());
^~~~~~
trunc
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\exportSet.cpp: In member function 'void PhyphoxBleExperiment::ExportSet::setXMLAttribute(const char*)':
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\exportSet.cpp:20:39: error: 'string' is not a member of 'std'
copyToMem(&XMLAttribute, (" " + std::string(xml)).c_str());
^~~~~~
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\exportSet.cpp:20:39: note: suggested alternative: 'trunc'
copyToMem(&XMLAttribute, (" " + std::string(xml)).c_str());
^~~~~~
trunc
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\experiment.cpp: In member function 'void PhyphoxBleExperiment::setColor(const char*)':
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\experiment.cpp:73:26: error: 'string' is not a member of 'std'
copyToMem(&COLOR, (std::string(c)).c_str());
^~~~~~
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\experiment.cpp:73:26: note: suggested alternative: 'trunc'
copyToMem(&COLOR, (std::string(c)).c_str());
^~~~~~
trunc
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\exportdata.cpp: In member function 'void PhyphoxBleExperiment::ExportData::setXMLAttribute(const char*)':
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\exportdata.cpp:11:40: error: 'string' is not a member of 'std'
copyToMem(&XMLAttribute, (" " + std::string(xml)).c_str());
^~~~~~
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\exportdata.cpp:11:40: note: suggested alternative: 'trunc'
copyToMem(&XMLAttribute, (" " + std::string(xml)).c_str());
^~~~~~
trunc
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\exportdata.cpp: In member function 'virtual void PhyphoxBleExperiment::ExportData::setLabel(const char*)':
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\exportdata.cpp:16:26: error: 'string' is not a member of 'std'
copyToMem(&LABEL, (std::string(l)).c_str());
^~~~~~
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\exportdata.cpp:16:26: note: suggested alternative: 'trunc'
copyToMem(&LABEL, (std::string(l)).c_str());
^~~~~~
trunc
exit status 1
Compilation error: exit status 1
I've even tried to upload the original CreateExperiment skech but it gives me the same error
I'm stuck here for now.
could you share some more informatione about your current setup? Which microcontroller and software versions (board firmware, library version) are you using? Unfortunately I cannot reproduce this issue.
Thank you to both of you.
I am using an Arduino NANO 33 IoT, with dirvers version 1.4.3.0 on Arduino IDE 2.2.1. The phyphoxBLE library I used was 1.2.0.
Anyway. I tried to installe the 1.1.2 version of the library and I tried to upload the Createexperiment sketch as is.
It is compiling and uploading the sketch but when I try to connect the device to the app it just start loading the experiment but then do nothing.
After this I tried to search again for the device and the app didn't find it.
Just once I got this error message on the app:
"it is not possible to abilitate the notification of the Bluetooth Characteristic with UUID cddf0002-30f7-4671-8b43-5e40ba53514a."
Now if I try to upload the sketch again or any other sketch on the board the Arduino IDE compiles the sketch but then doesn't upload it without giving any error.
(09-15-2023, 09:07 PM)PBra Wrote: I've tried the solution you suggested but I couldn't upload the sketch on the board as it gives my error.
This is the sketch I've written following the example that I found on github "CreateExperiment"
GetACC_From_ARDUINO.setTitle("get_acc");
GetACC_From_ARDUINO.setCategory("Arduino Experiments");
GetACC_From_ARDUINO.setDescription("Random numbers are generated on Arduino and visualized with phyphox afterwards");
//View
PhyphoxBleExperiment::View firstView;
firstView.setLabel("FirstView"); //Create a "view"
//PhyphoxBleExperiment::View secondView;
//secondView.setLabel("SecondView"); //Create a "view"
//Graph
PhyphoxBleExperiment::Graph firstGraph; //Create graph which will plot random numbers over time
firstGraph.setMinY(0, LAYOUT_FIXED);
firstGraph.setMaxY(1000, LAYOUT_FIXED);
firstGraph.setLabel("Acceleration");
firstGraph.setUnitX("s");
firstGraph.setUnitY("m/s^2");
firstGraph.setLabelX("time");
firstGraph.setLabelY("Acc");
firstGraph.setXPrecision(1); //The amount of digits shown after the decimal point
firstGraph.setYPrecision(1);
/* Assign Channels, so which data is plotted on x or y axis
first parameter represents x-axis, second y-axis
Channel 0 means a timestamp is created after the BLE package arrives in phyphox
Channel 1 to N corresponding to the N-parameter which is written in server.write()
*/
firstGraph.setChannel(0, 1);
//Second Graph
PhyphoxBleExperiment::Graph secondGraph; //Create graph which will plot random numbers over time
secondGraph.setMinY(0, LAYOUT_FIXED);
secondGraph.setMaxY(1000, LAYOUT_FIXED);
secondGraph.setLabel("Acceleration");
secondGraph.setUnitX("s");
secondGraph.setUnitY("m/s^2");
secondGraph.setLabelX("time");
secondGraph.setLabelY("Acc");
secondGraph.setXPrecision(1); //The amount of digits shown after the decimal point
secondGraph.setYPrecision(1);
/* Assign Channels, so which data is plotted on x or y axis
first parameter represents x-axis, second y-axis
Channel 0 means a timestamp is created after the BLE package arrives in phyphox
Channel 1 to N corresponding to the N-parameter which is written in server.write()
*/
secondGraph.setChannel(0, 2);
//Third Graph
PhyphoxBleExperiment::Graph thirdGraph; //Create graph which will plot random numbers over time
thirdGraph.setMinY(0, LAYOUT_FIXED);
thirdGraph.setMaxY(1000, LAYOUT_FIXED);
thirdGraph.setLabel("Acceleration");
thirdGraph.setUnitX("s");
thirdGraph.setUnitY("m/s^2");
thirdGraph.setLabelX("time");
thirdGraph.setLabelY("Acc");
thirdGraph.setXPrecision(1); //The amount of digits shown after the decimal point
thirdGraph.setYPrecision(1);
/* Assign Channels, so which data is plotted on x or y axis
first parameter represents x-axis, second y-axis
Channel 0 means a timestamp is created after the BLE package arrives in phyphox
Channel 1 to N corresponding to the N-parameter which is written in server.write()
*/
thirdGraph.setChannel(0, 3);
//Info
//PhyphoxBleExperiment::InfoField myInfo; //Creates an info-box.
//myInfo.setInfo("This is an Info field!");
//myInfo.setColor("890128"); //Sets font color. Uses a 6 digit hexadecimal value in "quotation marks".
//myInfo.setXMLAttribute("size=\"1.2\"");
//Separator
//PhyphoxBleExperiment::Separator mySeparator; //Creates a line to separate elements.
//mySeparator.setHeight(0.3); //Sets height of the separator.
//mySeparator.setColor("404040"); //Sets color of the separator. Uses a 6 digit hexadecimal value in "quotation marks".
//Value
//PhyphoxBleExperiment::Value myValue; //Creates a value-box.
//myValue.setLabel("Number"); //Sets the label
//myValue.setPrecision(2); //The amount of digits shown after the decimal point.
//myValue.setUnit("unit"); //The physical unit associated with the displayed value.
//myValue.setColor("FFFFFF"); //Sets font color. Uses a 6 digit hexadecimal value in "quotation marks".
//myValue.setChannel(0);
//myValue.setXMLAttribute("size=\"2\"");
//Export
PhyphoxBleExperiment::ExportSet mySet; //Provides exporting the data to excel etc.
mySet.setLabel("mySet");
PhyphoxBleExperiment::ExportData myData1;
myData1.setLabel("myData1");
myData1.setDatachannel(1);
firstView.addElement(firstGraph); //attach graph to view
firstView.addElement(secondGraph); //attach second graph to view
firstView.addElement(thirdGraph); //attach second graph to view
//secondView.addElement(myInfo); //attach info to view
//secondView.addElement(mySeparator); //attach separator to view
//secondView.addElement(myValue); //attach value to view
GetACC_From_ARDUINO.addView(firstView); //attach view to experiment
mySet.addElement(myData1); //attach data to exportSet
mySet.addElement(myData2); //attach data to exportSet
mySet.addElement(myData3); //attach data to exportSet
GetACC_From_ARDUINO.addExportSet(mySet); //attach exportSet to experiment
PhyphoxBLE::addExperiment(GetACC_From_ARDUINO); //attach experiment to server
}
void loop()
{
float x, y, z;
IMU.readAcceleration(x, y, z);
/* The random number is written into Channel 1
Up to 5 Channels can written at the same time with server.write(randomDistance, valueChannel2, valueChannel3.. )
*/
PhyphoxBLE::write(x,y,z);
delay(50);
PhyphoxBLE::poll(); //Only required for the Arduino Nano 33 IoT, but it does no harm for other boards.
}
when I try to upload the sketch I get this error
Code:
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\errorhandler.cpp: In member function 'virtual PhyphoxBleExperiment::Error PhyphoxBleExperiment::Errorhandler::err_checkLength(const char*, int, const char*)':
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\errorhandler.cpp:8:55: error: 'string' is not a member of 'std'
copyToMem(&ret.MESSAGE, ("ERR_01, in " + std::string(origin) + "(). \n").c_str());
^~~~~~
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\errorhandler.cpp:8:55: note: suggested alternative: 'trunc'
copyToMem(&ret.MESSAGE, ("ERR_01, in " + std::string(origin) + "(). \n").c_str());
^~~~~~
trunc
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\errorhandler.cpp: In member function 'virtual PhyphoxBleExperiment::Error PhyphoxBleExperiment::Errorhandler::err_checkUpper(int, int, const char*)':
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\errorhandler.cpp:16:55: error: 'string' is not a member of 'std'
copyToMem(&ret.MESSAGE, ("ERR_02, in " + std::string(origin) + "(). \n").c_str());
^~~~~~
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\errorhandler.cpp:16:55: note: suggested alternative: 'trunc'
copyToMem(&ret.MESSAGE, ("ERR_02, in " + std::string(origin) + "(). \n").c_str());
^~~~~~
trunc
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\errorhandler.cpp: In member function 'virtual PhyphoxBleExperiment::Error PhyphoxBleExperiment::Errorhandler::err_checkHex(const char*, const char*)':
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\errorhandler.cpp:24:55: error: 'string' is not a member of 'std'
copyToMem(&ret.MESSAGE, ("ERR_03, in " + std::string(origin) + "(). \n").c_str());
^~~~~~
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\errorhandler.cpp:24:55: note: suggested alternative: 'trunc'
copyToMem(&ret.MESSAGE, ("ERR_03, in " + std::string(origin) + "(). \n").c_str());
^~~~~~
trunc
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\errorhandler.cpp:28:59: error: 'string' is not a member of 'std'
copyToMem(&ret.MESSAGE, ("ERR_03, in " + std::string(origin) + "(). \n").c_str());
^~~~~~
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\errorhandler.cpp:28:59: note: suggested alternative: 'trunc'
copyToMem(&ret.MESSAGE, ("ERR_03, in " + std::string(origin) + "(). \n").c_str());
^~~~~~
trunc
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\errorhandler.cpp: In member function 'virtual PhyphoxBleExperiment::Error PhyphoxBleExperiment::Errorhandler::err_checkStyle(const char*, const char*)':
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\errorhandler.cpp:37:55: error: 'string' is not a member of 'std'
copyToMem(&ret.MESSAGE, ("ERR_04, in " + std::string(origin) + "(). \n").c_str());
^~~~~~
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\errorhandler.cpp:37:55: note: suggested alternative: 'trunc'
copyToMem(&ret.MESSAGE, ("ERR_04, in " + std::string(origin) + "(). \n").c_str());
^~~~~~
trunc
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\errorhandler.cpp: In member function 'virtual PhyphoxBleExperiment::Error PhyphoxBleExperiment::Errorhandler::err_checkLayout(const char*, const char*)':
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\errorhandler.cpp:44:51: error: 'string' is not a member of 'std'
copyToMem(&ret.MESSAGE, ("ERR_05, in " + std::string(origin) + "(). \n").c_str());
^~~~~~
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\errorhandler.cpp:44:51: note: suggested alternative: 'trunc'
copyToMem(&ret.MESSAGE, ("ERR_05, in " + std::string(origin) + "(). \n").c_str());
^~~~~~
trunc
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\errorhandler.cpp: In member function 'virtual PhyphoxBleExperiment::Error PhyphoxBleExperiment::Errorhandler::err_checkSensor(const char*, const char*)':
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\errorhandler.cpp:51:55: error: 'string' is not a member of 'std'
copyToMem(&ret.MESSAGE, ("ERR_04, in " + std::string(origin) + "(). \n").c_str());
^~~~~~
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\errorhandler.cpp:51:55: note: suggested alternative: 'trunc'
copyToMem(&ret.MESSAGE, ("ERR_04, in " + std::string(origin) + "(). \n").c_str());
^~~~~~
trunc
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\errorhandler.cpp: In member function 'virtual PhyphoxBleExperiment::Error PhyphoxBleExperiment::Errorhandler::err_checkComponent(const char*, const char*)':
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\errorhandler.cpp:59:55: error: 'string' is not a member of 'std'
copyToMem(&ret.MESSAGE, ("ERR_04, in " + std::string(origin) + "(). \n").c_str());
^~~~~~
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\errorhandler.cpp:59:55: note: suggested alternative: 'trunc'
copyToMem(&ret.MESSAGE, ("ERR_04, in " + std::string(origin) + "(). \n").c_str());
^~~~~~
trunc
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\element.cpp: In member function 'virtual void PhyphoxBleExperiment::Element::setLabel(const char*)':
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\element.cpp:6:26: error: 'string' is not a member of 'std'
copyToMem(&LABEL, (std::string(l)).c_str());
^~~~~~
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\element.cpp:6:26: note: suggested alternative: 'trunc'
copyToMem(&LABEL, (std::string(l)).c_str());
^~~~~~
trunc
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\edit.cpp: In member function 'void PhyphoxBleExperiment::Edit::setUnit(const char*)':
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\edit.cpp:7:28: error: 'string' is not a member of 'std'
copyToMem(&UNIT, (std::string(u)).c_str());
^~~~~~
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\edit.cpp:7:28: note: suggested alternative: 'trunc'
copyToMem(&UNIT, (std::string(u)).c_str());
^~~~~~
trunc
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\edit.cpp: In member function 'void PhyphoxBleExperiment::Edit::setXMLAttribute(const char*)':
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\edit.cpp:24:39: error: 'string' is not a member of 'std'
copyToMem(&XMLAttribute, (" " + std::string(xml)).c_str());
^~~~~~
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\edit.cpp:24:39: note: suggested alternative: 'trunc'
copyToMem(&XMLAttribute, (" " + std::string(xml)).c_str());
^~~~~~
trunc
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\exportSet.cpp: In member function 'void PhyphoxBleExperiment::ExportSet::setLabel(const char*)':
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\exportSet.cpp:16:39: error: 'string' is not a member of 'std'
copyToMem(&LABEL, (" name=\"" + std::string(l) + "\"").c_str());
^~~~~~
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\exportSet.cpp:16:39: note: suggested alternative: 'trunc'
copyToMem(&LABEL, (" name=\"" + std::string(l) + "\"").c_str());
^~~~~~
trunc
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\exportSet.cpp: In member function 'void PhyphoxBleExperiment::ExportSet::setXMLAttribute(const char*)':
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\exportSet.cpp:20:39: error: 'string' is not a member of 'std'
copyToMem(&XMLAttribute, (" " + std::string(xml)).c_str());
^~~~~~
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\exportSet.cpp:20:39: note: suggested alternative: 'trunc'
copyToMem(&XMLAttribute, (" " + std::string(xml)).c_str());
^~~~~~
trunc
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\experiment.cpp: In member function 'void PhyphoxBleExperiment::setColor(const char*)':
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\experiment.cpp:73:26: error: 'string' is not a member of 'std'
copyToMem(&COLOR, (std::string(c)).c_str());
^~~~~~
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\experiment.cpp:73:26: note: suggested alternative: 'trunc'
copyToMem(&COLOR, (std::string(c)).c_str());
^~~~~~
trunc
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\exportdata.cpp: In member function 'void PhyphoxBleExperiment::ExportData::setXMLAttribute(const char*)':
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\exportdata.cpp:11:40: error: 'string' is not a member of 'std'
copyToMem(&XMLAttribute, (" " + std::string(xml)).c_str());
^~~~~~
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\exportdata.cpp:11:40: note: suggested alternative: 'trunc'
copyToMem(&XMLAttribute, (" " + std::string(xml)).c_str());
^~~~~~
trunc
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\exportdata.cpp: In member function 'virtual void PhyphoxBleExperiment::ExportData::setLabel(const char*)':
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\exportdata.cpp:16:26: error: 'string' is not a member of 'std'
copyToMem(&LABEL, (std::string(l)).c_str());
^~~~~~
C:\Users\paolo\Documents\Arduino\libraries\phyphox_BLE\src\exportdata.cpp:16:26: note: suggested alternative: 'trunc'
copyToMem(&LABEL, (std::string(l)).c_str());
^~~~~~
trunc
exit status 1
Compilation error: exit status 1
I've even tried to upload the original CreateExperiment skech but it gives me the same error
I'm stuck here for now.
Dominik could fix this bug that is surprisingly not triggered on other boards. We should do a bit of testing before we release it.