Arduino Forum

Products => Create => Editor => Topic started by: jomoengineer on Mar 25, 2019, 07:27 am

Title: Code added by Add Tab Disappears
Post by: jomoengineer on Mar 25, 2019, 07:27 am
Each time I add my own code to the Create Editor using the Add Tab option it disappears when I come back to the Editor.  I'm using Ubuntu Linux 16.04.6 and Firefox.

Is there a way to get the code to stay with the project?
Title: Re: Code added by Add Tab Disappears
Post by: pert on Mar 25, 2019, 07:41 am
If you don't have "Enable Autosave" checked in your Preferences, you'll need to hover your mouse over the button with the three dots and then click "Save" before you close the Arduino Web Editor in your browser.
Title: Re: Code added by Add Tab Disappears
Post by: ballscrewbob on Mar 25, 2019, 08:43 am
Also ensure tabs have something in them

IIRC empty tabs didn't used to be saved.

Title: Re: Code added by Add Tab Disappears
Post by: jomoengineer on Mar 25, 2019, 04:24 pm
Yes, I ensure I have something in them otherwise the code would not compile since I am referencing it in the application.   I've tried to use the Save option at the top of the screen (under the three dot menu) and the only Tab of the code I added that gets saved is the .h file, not the .cpp file.   Each time I use the Editor I have to add a tab for the .cpp file before I can compile the code again.

If I download the code from the three dot menu after adding all of my own code via the tabs, then the code is saved locally will all files in it.  However, if I close the browser window or click "GO TO IOT CLOUD" and go back to the Editor, the .cpp file is missing again.
Title: Re: Code added by Add Tab Disappears
Post by: pert on Mar 25, 2019, 11:13 pm
What is the name of the .cpp tab?

After you do the save, do you see the little message that pops up and says "{sketch name} saved", where {sketch name} is the name of your sketch?
Title: Re: Code added by Add Tab Disappears
Post by: jomoengineer on Mar 26, 2019, 06:27 am
The Tabs are labeled:

RobotArm.h
RobotArm.cpp
 
I am able to download the code from the Create Editor and compile it fine in the Arduino IDE and load it into a MKR1000 without issue.

This did require installing the following libraries into the Arduino IDE via Manage Libraries to get it to compile though.

ArduinoIoTCloud
ArduinoMqttClient
ArduinoIoTCloudBearSSL
ArduinoBearSSL
ArduinoCloudThing
ArduinoECCX08
RTCZero


There were a number of warnings seen for the debugMessage method, although no issues for the code I added.

Code: [Select]
/home/jomoros/Arduino/libraries/ArduinoIoTCloud/src/EthernetConnectionManager.cpp: In member function 'virtual void EthConnectionManager::check()':
/home/jomoros/Arduino/libraries/ArduinoIoTCloud/src/EthernetConnectionManager.cpp:72:55: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
           debugMessage("No Ethernet chip connected", 0);
                                                       ^
/home/jomoros/Arduino/libraries/ArduinoIoTCloud/src/EthernetConnectionManager.cpp:83:66: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
           debugMessage("Failed to configure Ethernet via dhcp", 0);




Cheers,

Jon