ChipChop Support Forum
Log in
Log out
Join the forum
My Details
REPLIES: 32
VIEWS: 148
BACK
REPLY TO THIS POST
Swapfile
19 Jan 2025
ESP32 Wroom DA not in list and many more questions.
Hallo.
I just got my account activated today, so I have no idea what I am doing.

1.My esp32 Wroom DA is not in the list , does it matter , I can select it from the Arduino ide.

2.The Time zone , my country is not listed , GMT +2 , so can I pick any GMT +2 Country?

3.Where do I enter my WiFi Name and Password , is it on the Console or must I add it to downloaded Arduino sketch?

4.Is there a step by step Tutorial for Chip-Chop?
Gizmo
19 Jan 2025

Hi Swap,

Don't worry, I'll guide you step by step :-)

1. If you are using Arduino IDE you can select any board (this only needs to be accurate if you are using PlatformIO) and specify it through Arduino IDE ( for Wroom it would be "ESP32 Dev")

2. Timezone - yes, you can choose any country in GMT+2 that has same daylight saving (if your country is following winter/summer time changes). If you tell me which country/city you are in I can see if I can add it to the database, just tell me exactly how it's set it on your PC or phone it should be in the format - continent/city
Damn, I thought I knew all countries/timezones in GMT+2 !? Is it Africa/Windhoek, looks like that one may be missing?

3. The Wifi details you would add in the sketch manually but if you are using the Code Builder it will generate a starting .ino sketch and you will see the place for the wifi details to fill in.

4. Tutorials

The link to the tutorials is in the top menu of chipchop.io (https://www.chipchop.io/projects)

The Code Builder is pretty new so there is no tutorial for it yet and I am working on some interface updates right now so I can't film a tutorial until I'm finished but it's pretty simple to use.

Here is a simplified explanation of the process but you should still watch at leats the first two tutorials as that also covers what you need to do in the Dev Console:

- Because you are using an ESP32 first download this: https://chipchop.io/downloads/WebSockets2_Generic-modified.zip
    unzip it and copy the folder "WebSockets2_Generic-modified" to Documents/Arduino/libraries
    If you do this step you don't need to install the websockets library as shown in the tutorials and this version is optimised for ESP32/8266

- Fill in what you need in the Code Builder and download the project zip file for Arduino IDE.
    unzip it and inside you will find a folder with the same name as your device, drag the entire folder into Documents/Arduino/ (there is also an instruction.txt inside that you can read)

- close and open Arduino IDE (if it was opened) and the project will appear in the Arduino list or you can also open the included .ino sketch but you need to have the entire folder with the sketch & src folder in Documents/Arduino as all these files are needed.

After that just edit the sketch and add what else you need and compile and you can also follow the other tutorials on https://www.chipchop.io/projects
Basically, the Code Builder includes inside the downloaded zip in the "src" folder the entire ChipChop library and few supporting files so each project is pretty much self contained and if you include some plugin it's also a part of the package (nothing extra to install in Arduino IDE)

Alternatively, you can use the manual way as it's showing in the tutorials by downloading the separate ChipChop Library here: https://www.chipchop.io/api_docs/chipchop-arduino-library


See if you can get the Smart Led working and if you get stuck just let me know at what step and I'll help you out. Once you get through this first time setup and get an led to blink successfully it will all make sense and will be very easy after that :-)

Let me know how it goes


Swapfile
20 Jan 2025

Thanks.

1.The core that I added for the ESP32 Wroom does have that spesific name , the same as the Board , I will try the Wroom option first in the Arduino ide .
I can program the ESP32 selecting the Wroom option , just a little Blink led to test.

2.On my PC its Harare +2 , very far from me but thats Microsoft.

3.I only spend around 20 minutes on the Chip chop site so there is a lot to learn.

4.How do I add a Button.

5.Is there a Phone app that I can use to access the button.
Swapfile
20 Jan 2025

Regarding point 4. and 5. I should first look at the Tutorials , had a small peek at them and that is where I MUST start.
Gizmo
20 Jan 2025

Hiya,

point 2 - Harare is in the timezone list so you can use that one but also Cairo or any other that match your timezone.

Explanation: ChipChop doesn't really care about the exact location, the only important parameters are correct +- hour time difference and the DST (daylight saving time), it's purely for your benefit to be reasonably accurate so if you are setting some time sensitive Actions they get executed at a correct time and also when you are checking the device status on the ChipChop App or Dev Console it will show you the correct time for the device.
Also, you get a free correct timestamp for the device sent by the ChipChop server as a response to every heartbeat so if you have something like a screen with you device you can display the current time without buying an RTC module or messing around with NTP servers and doing time calculations/conversions etc.


point 4,5 - ha ha, yes, definitely watch the damn tutorials, you have all the basics explained and easy to replicate. If you can't get the Smart Led to work, let me know and I'll find some spare time so we can have a quick live session on Google meets and I'll share my screen so you can replicate the steps on yours (it's a 5 min job and once you do it once it's the same thing for everything else)

For the ChipChop app you just need to visit https://my.chipchop.io on your phone. Best is to access it with Goggle chrome on Android or Safari on iOS and use "Share >> Add to home screen", after that it will appear as an app on your phone and you just need to login with the same details as for the Dev Console and you will see all your devices appear and can be controlled.

Keep me posted, watch the first 2-3 tutorials and we'll get you going in no time
Swapfile
20 Jan 2025

Yes I saw that thanks , I was looking for Harare but it is under Arfica.

I have a new problem -- followed the Smart Led tutorial , done everything hopefully correct.

Unzip the downloaded folder and copy it to DOCUMENTS/LIBRARIES.

When I open the Arduino sketch from that folder and try to compile , I get an error.


Multiple libries found for WiFI.h and also invalid Chip Chop library no header files.

The folder that I copied has got another folder inside with all the file in there , maybe thats the problem.


I cannot for some reason copy the Arduino error console here.


        


Gizmo
20 Jan 2025

No worries, it can get confusing with the zip file...not my fault, it's how the OS decides to unzip stuff (it can be different between Win/Mac/Linux), so if you find inside the unzipped folder another one with the same name then it's that inside folder you need

Have a look at the screenshot in the explanation I've give here: https://forum.chipchop.io/post/568/


Actually hold on, just so I don't confuse you more, are you using the Code Builder but also following a tutorial exactly how it's showing on the video?

There is a slight difference if you are using the Code Builder that could confuse Arduino IDE, here are the correct steps

For Code Builder project

1. If you've followed the first tutorial showing to download the ChipChop library and manually add it to Arduino IDE then delete the folder Documents/Arduino/libraries/ChipChop-1.41 or Documents/Arduino/libraries/ChipChop_Arduino-1.41
    - It will be included automatically with the Code Builder package so it may be causing a conflict if there is another copy in the Arduino library folder

2. If you've installed Websockets2_Generic using the Arduino IDE library manager then remove it through Arduino IDE Library Manager, you are using ESP32 and the version through Arduino IDE is crap and I think was even broken few months ago
    - download the modfified version here: https://chipchop.io/downloads/WebSockets2_Generic-modified.zip
    - unzip the file
    - depending on your OS (Win/Mac) the unzipped stuff may look different, you need to copy the entire folder "WebSockets2_Generic-modified 2" into Documents/Arduino/libraries/ but if you find inside the "WebSockets2_Generic-modified 2" another sub-folder with the same name then it's that folder inside you need


Yeah, sorry the tutorials are slightly different because they don't contain the Code Builder option yet. Everything else is pretty much the same and I would definitely recommend for you to use the Code Builder as there are some very useful features available there.

Also, don't forget, anything you add manually to the Arduino IDE folders in the Documents you will need to restart it so it can pickup the changes

If you don't get it working this time let me know
Swapfile
20 Jan 2025

Thanks , yes I used the Code Builder as in the second Tutorial >> Smart Led.

I also did install Websockets2 as in Tutorial 1 with the Arduino Library Manager.

I will try your last reply .. so much to do so little time.

When I select the Board from the Arduino ide must I select it from the Core I added or will there be a new ChipChop board option in the ide?
Gizmo
20 Jan 2025

Yeah I know, never enough time!

Ah, unfortunately Arduino IDE is not that clever so you need to select the board yourself from the core. So it doesn't really matter what you pick in the Code Builder (PlatformIO will pick it up automatically though and allows to add extra things but not Arduino IDE)

One day when you have more time have a try at using VS Code + PlatformIO extension. It's a really good way to work with ESPs and other micro-controllers. You will still use Arduino as a programming framework but in terms of the IDE itself, how the projects are structured and things you can achieve it's much better
(for me having to make ChipChop compatible for Arduino IDE is a real pain because it's seriously limiting)

Swapfile
20 Jan 2025

From the link that you said ..LOOK HERE to another forum query , there is some conflick.

In that link the folder should be copied to DOCUMENTS/ARDUINO

and

In the reply to me you said DOCUMENTS/ARDUINO/LIBRARIES.

Any way I am using a deferent PC at home now , no other wedsocket libraries was installed thru the Library manager.

I did however download the websocket from your link , unzip , took the folder inside the first folder and copy it to DOCUMENTS/ARDUINO/LIBRARIES.

When I compile in the ide (Arduino) Manager.h is not found.
Swapfile
20 Jan 2025

Ooo! and there is more trouble , when I click on my Account to get the device id and the rest of the credentials to past into the Arduino sketch the screen just gives a fast blink but does not open the device info to copy.
Gizmo
20 Jan 2025


The copy button in the My Account copies the stuff automatically in your PC clipboard so there is nothing for you to manually select. You should be able to just press it and then go to your sketch and press Ctrl+V to paste

Another option is in the Device section when you select the device you have in the panel on the right the "View & Copy Details", when you press that you should get a popup screen and there you can manually select, copy and then paste into the sketch

And final resort if your web browser is an ass and is not handling auto-copy to clipboard or blocks the little popup you can just select the text line by line manually in the My Account

Not sure what's that with Manager.h missing, can you please do me a favour and in the My Account down at the bottom click on "Generate access key" and then post it here (don't worry only I have use for it so it can be posted publicly)

I am going to have a look what you have setup in the Dev Console
Gizmo
20 Jan 2025

also, are you adding any plugins in the Code Builder?
Swapfile
20 Jan 2025

ok , on my win 11 pc I could click on account and get the credentials to past into the sketch.

But my win10 does not open the Account tab , but I saw that I could copy it from the far right plane in the Device window.

Sorry I should have said ChipChopManager.h.

I manually added that file to the ide , the compile time is way longer and also the progress bar , but now WiFi mulitple files were found.

This is my error.



        Arduino: 1.8.12 (Windows 10), Board: "ESP32-WROOM-DA Module, Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS), 240MHz (WiFi/BT), QIO, 80MHz, 4MB (32Mb), 115200, Core 1, Core 1, None, Disabled"

c:/users/mike/appdata/local/arduino15/packages/esp32/tools/esp-x32/2302/bin/../lib/gcc/xtensa-esp32-elf/12.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: sketch\smart-led.ino.cpp.o:(.literal._Z26ChipChop_onCommandReceived6StringS_S_i+0x18): undefined reference to `ChipChopManager::updateStatus(String, String)'

c:/users/mike/appdata/local/arduino15/packages/esp32/tools/esp-x32/2302/bin/../lib/gcc/xtensa-esp32-elf/12.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: sketch\smart-led.ino.cpp.o:(.literal._Z5setupv+0x38): undefined reference to `ChipChopManager::start(String, String, String, String)'

c:/users/mike/appdata/local/arduino15/packages/esp32/tools/esp-x32/2302/bin/../lib/gcc/xtensa-esp32-elf/12.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: sketch\smart-led.ino.cpp.o:(.literal._Z4loopv+0x0): undefined reference to `ChipChopManager::run()'

c:/users/mike/appdata/local/arduino15/packages/esp32/tools/esp-x32/2302/bin/../lib/gcc/xtensa-esp32-elf/12.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: sketch\smart-led.ino.cpp.o:(.literal.startup._GLOBAL__sub_I_BAUD_RATE+0x10): undefined reference to `ChipChopManager::ChipChopManager()'

c:/users/mike/appdata/local/arduino15/packages/esp32/tools/esp-x32/2302/bin/../lib/gcc/xtensa-esp32-elf/12.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: sketch\smart-led.ino.cpp.o: in function `ChipChop_onCommandReceived(String, String, String, int)':

C:\Users\mike\Documents\Arduino\ChipChop_Arduino-1.41\ChipChop-1.41\examples\smart-led/smart-led.ino:55: undefined reference to `ChipChopManager::updateStatus(String, String)'

c:/users/mike/appdata/local/arduino15/packages/esp32/tools/esp-x32/2302/bin/../lib/gcc/xtensa-esp32-elf/12.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: sketch\smart-led.ino.cpp.o: in function `setup()':

C:\Users\mike\Documents\Arduino\ChipChop_Arduino-1.41\ChipChop-1.41\examples\smart-led/smart-led.ino:79: undefined reference to `ChipChopManager::start(String, String, String, String)'

c:/users/mike/appdata/local/arduino15/packages/esp32/tools/esp-x32/2302/bin/../lib/gcc/xtensa-esp32-elf/12.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\mike\Documents\Arduino\ChipChop_Arduino-1.41\ChipChop-1.41\examples\smart-led/smart-led.ino:82: undefined reference to `ChipChopManager::updateStatus(String, String)'

c:/users/mike/appdata/local/arduino15/packages/esp32/tools/esp-x32/2302/bin/../lib/gcc/xtensa-esp32-elf/12.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: sketch\smart-led.ino.cpp.o: in function `loop()':

C:\Users\mike\Documents\Arduino\ChipChop_Arduino-1.41\ChipChop-1.41\examples\smart-led/smart-led.ino:89: undefined reference to `ChipChopManager::run()'

c:/users/mike/appdata/local/arduino15/packages/esp32/tools/esp-x32/2302/bin/../lib/gcc/xtensa-esp32-elf/12.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: sketch\smart-led.ino.cpp.o: in function `ChipChopManager::_EVENT::~_EVENT()':

C:\Users\mike\Documents\Arduino\ChipChop_Arduino-1.41\ChipChop-1.41\examples\smart-led/ChipChopManager.h:57: undefined reference to `ChipChopManager::ChipChopManager()'

collect2.exe: error: ld returned 1 exit status
Multiple libraries were found for "WiFi.h"
Used: C:\Users\mike\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.7\libraries\WiFi
Not used: C:\Users\mike\Documents\Arduino\libraries\WiFiNINA
Not used: C:\Program Files (x86)\Arduino\libraries\WiFi
exit status 1
Error compiling for board ESP32-WROOM-DA Module.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.



Gizmo
20 Jan 2025

ok, I have to take a break and have a dinner but I will check that in half an hour and also my Arduino IDE decided to start downloading a ton of updates so I need to wait for it to finish
Swapfile
20 Jan 2025

I cannot open MY ACCOUNT screen just gives quick blink.

I did logout and login again after about 10 tries the Account screen opened.
Gizmo
20 Jan 2025

Well, this was a nightmare!

I can no longer compile anything to work on ESP32-C3 with Arduino IDE, even an empty sketch with just a wifi connection code once pushed on the esp keeps coming up with some interesting error: wifi:Association refused too many times, max allowed 1
That's some serious f***p with the Esp32 core on Arduino!

I've managed to finally get some poor ESP32 Wroom 32D to work (but could only push the code as NodeMCU-32S!? ) and I've found another change required with this esp32 core and the websockets so this is the third time I had to modify that library in 6 months.

Anyways, I've made you a package to download, it all definitely works so here are the instructions.

1. Arduino IDE is seriously flaky with the esp core so make sure to update it fully, I had to update it again although I am sure I've done that not long ago so my version now is vs. 2.3.4

2. in the Boards Manager find "esp32" and update if needed, current version is 3.1.1 (be careful it's not not "Arduino ESP32 boards" it's just called "esp32")

3. close Arduino IDE

4. Delete from Documents/Arduino/libraries the WebSockets2_Generic-modified and ChipChop_Arduino-1.41
The errors you were getting are referring to the ChipChop lib 1.41, you don't need it as Code Builder includes the latest version and in the sketch it's now called ChipChopEngine.h not ChipChopManager.h
Also all the paths will be different, and should now start with src/....

5. Download this: https://chipchop.io/various/esp_test.zip

6. inside when unzipped copy the folders:

    - Smart_Led to Documents/Arduino
        if you already have a Smart_Led project move it temporarily somewhere and use this one

    - WebSockets2_Generic-modified to Documents/Arduino/libraries

7. start Arduino IDE and open the Smart_Led.ino

Now you can edit the code, add your ChipChop credentials, Wifi and the smart led bits from the tutorials
Just make sure to keep all #includes as they are and the two line in the run() you can write anything you want below.


This is a plain template code and if you follow the steps above exactly and you still get error when compiling then we will have to have a deeper look at your Arduino IDE installation.

Let me know how it goes

p.s. fiy, the project is not just the single Smart_led.ino file it also needs the supporting classes in the "src" folder inside so if you want to move it or duplicate it's the entire folder "Smart_Led" folder
Swapfile
21 Jan 2025

Congradulation!!

You did it.Compiles and download.

1.I am still on Arduino ver 1.8.19 never used ver 2.xx it seems to be very byggy.

2.I can see that the ESP32 is connected to the WiFi by looking at the Blue Led (Did connect it to Arduino Cloud once )

3.How do I see the status of the device in the ChipChop console?

4.I also rebuild my Smart_Led , what to do next?

5.The Websockets2 from your example is already in my Library , must I remove it and replace it with the one from my Smart_Led?
Swapfile
21 Jan 2025

Ok , I see in the DASHBOARD screen that it shows Devices online = 1 and when I remove the power online = 0.
Swapfile
21 Jan 2025

I deleted my Smart_Led Device console and started over naming it Smart+Led2 use the code builder and followed the steps as with your example.

But still get more or less the same errors.

Arduino: 1.8.19 (Windows 10), Board: "ESP32-WROOM-DA Module, Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS), 240MHz (WiFi/BT), QIO, 80MHz, 4MB (32Mb), 921600, Core 1, Core 1, None, Disabled"





















Multiple libraries were found for "WiFi.h"

smart-led:20:10: fatal error: ChipChopManager.h: No such file or directory

Used: C:\Users\mikee\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.1.1\libraries\WiFi

20 | #include <ChipChopManager.h>

Not used: C:\Program Files (x86)\Arduino\libraries\WiFi

| ^~~~~~~~~~~~~~~~~~~

Not used: C:\Users\mikee\Documents\Arduino\libraries\WiFiEspAT

compilation terminated.

exit status 1

Exception in thread "AWT-EventQueue-0" java.lang.Error: Error: could not match input

    at org.fife.ui.rsyntaxtextarea.modes.CPlusPlusTokenMaker.zzScanError(CPlusPlusTokenMaker.java:2095)

    at org.fife.ui.rsyntaxtextarea.modes.CPlusPlusTokenMaker.yylex(CPlusPlusTokenMaker.java:2343)

    at org.fife.ui.rsyntaxtextarea.modes.CPlusPlusTokenMaker.getTokenList(CPlusPlusTokenMaker.java:1919)

    at org.fife.ui.rsyntaxtextarea.RSyntaxDocument.getTokenListForLine(RSyntaxDocument.java:431)

    at org.fife.ui.rsyntaxtextarea.SyntaxView.getLineWidth(SyntaxView.java:306)

    at org.fife.ui.rsyntaxtextarea.SyntaxView.calculateLongestLine(SyntaxView.java:110)

    at org.fife.ui.rsyntaxtextarea.RSyntaxTextArea.refreshFontMetrics(RSyntaxTextArea.java:2106)

    at org.fife.ui.rsyntaxtextarea.RSyntaxTextArea.setFont(RSyntaxTextArea.java:2545)

    at processing.app.EditorTab.applyPreferences(EditorTab.java:333)

    at processing.app.Editor.lambda$selectTab$52(Editor.java:1457)

    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)

    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)

    at java.awt.EventQueue.access$500(EventQueue.java:97)

    at java.awt.EventQueue$3.run(EventQueue.java:709)

    at java.awt.EventQueue$3.run(EventQueue.java:703)

    at java.security.AccessController.doPrivileged(Native Method)

    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)

    at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)

    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)

    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)

    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)

    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)

    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)

    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

ChipChopManager.h: No such file or directory



This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Swapfile
21 Jan 2025

Update.

I deleted every thing and start over again.

This time the files in my download looks the same as your led example , it also compiles.

But

There is no ledPin in the arduino code.

I also did not get a websockets2 file in the download so I used the one from your test file and as I said it compiled.
Swapfile
21 Jan 2025

Below is my device screen shot, without the credentials.


Attached images
Gizmo
21 Jan 2025

ok, so we have made some progress!

The issues are all related to the Arduino IDE and the esp core that it's using, I can't tell exactly if it's also to do with the version of the ide itself maybe 1.8 is fine.

I have updated the websockets last night everywhere but to be safe I would just re download them and replace them just one more time.

The code builder works differently than the tutorials and I will explain how to use it but not right now, you will not get any led control code from it without using plugins so what you are getting is just an clean canvas only with the communication code setup and you need to fill in the rest.
Don't worry, you just need first to cover the very basics.

The compile error you have listed is again related to the ChipChop library vs 1.41 which you are not using so it sounds to me that you are following the tutorial and trying to compile the examples which won't work.

I am really sorry for this but I am working on a major update for the last 6 months and I can't re-film the tutorials so the info is not in sync. I don't want you to stop using the code builder because it's how things will work in the future so please follow the tutorials but keep in mind that you will have to tweak the code slightly.

So, from now on do this, setup your device in the Dev Console and download the project template from the Code Builder and put it in the Arduino IDE folder and open it.
Then open separately one of the examples in a different window, copy the code and then replace in the new code everything except the following

don't use this from the example:



        #include <ChipChopManager.h>
        ChipChopManager ChipChop;



it needs to stay in the code builder project


    #include "src/ChipChop_Config.h"
    #include "src/ChipChopEngine.h"
    extern ChipChopEngine ChipChop;
    #include "src/ChipChopPlugins.h"
    extern ChipChopPluginsManager ChipChopPlugins;
    #include "src/ChipChop_Includes.h"


in the setup it also needs this somewhere at the end

void setup(){

    .....all the code from the example and then

    ChipChopPlugins.start();


}




in the example code this


void loop(){

ChipChop.run();

}


needs to be


void loop(){

ChipChop.run();
ChipChopPlugins.run();

}



So, for your MyLedTwo, download the blank project from the code builder and open it and replace the code with this (of course add your credentials, wifi details and you may have to change the led pin number)





#include <Arduino.h>
#ifdef ESP32
#include <WiFi.h>
#else
#include <ESP8266WiFi.h>
#endif

#include "src/ChipChop_Config.h"
#include "src/ChipChopEngine.h"
extern ChipChopEngine ChipChop;
#include "src/ChipChopPlugins.h"
extern ChipChopPluginsManager ChipChopPlugins;
#include "src/ChipChop_Includes.h"

//The connection credentials can be found in the device settings Dev Console > Devices
String server_uri = "...your allocated Endpoint Server URI...";
String uuid = "...your ChipChop UUID ...";
String auth_code = "... your Security Authentication Code ...";
String device_id = "my_led_two";


String led_status = "OFF"; // the device will start with the led turned off
const int led_pin = 2; // define the pin that will control the led


void ChipChop_onCommandReceived(String target_component,String command_value, String command_source, int command_age){
Serial.println(target_component);
Serial.println(command_value);

if(target_component == "myLedTwo"){
if(command_value == "ON"){

led_status = "ON"; //update the status
digitalWrite(led_pin,LOW); // turn the led on

}else if(command_value == "OFF"){

led_status = "OFF";//update the status
digitalWrite(led_pin,HIGH); // turn the led off
}

}

ChipChop.updateStatus("myLedTwo",led_status); // Confirm the LED status change

}


void setup(){

Serial.begin(115200);
delay(1000);

WiFi.begin("< your SSID >", "< your wifi password >");

Serial.print("WiFi Connecting");
while (WiFi.status() != WL_CONNECTED)
{
delay(500);
Serial.print(".");
}

pinMode(led_pin,OUTPUT); // declare the led pin as an output
digitalWrite(led_pin,HIGH); // turn the led off, may have to change this to LOW

ChipChop.debug(true);
ChipChop.commandCallback(ChipChop_onCommandReceived);
ChipChop.start(server_uri, uuid, device_id, auth_code);

ChipChopPlugins.start();


ChipChop.updateStatus("led",led_status);

}

void loop(){

ChipChop.run();
ChipChopPlugins.run();

}



If this compiles and gets on the device ok, then open in Arduino IDE the serial monitor and you should see the communication getting established. In the Dev Console go to LIVE CONTROL and from there you can switch the led on and off



Swapfile
21 Jan 2025

Ok , thanks

What do you mean by this?What examples where.


QUOTE: Then open separately one of the examples in a different window


Also note that I cannot find myLedTwo arduino file in the Arduino examples even if I restart the ide.
I have to open the file from where I copy it >> documents>>arduino.
This not a big issue.

The previous compile error might be on my side .. when the code builder download the new file it somtimes have the same name or name(2) so I might have copied the wrong one.

My last successfull compile I deleted all the code builder files in downloads so that there is only one and less mistakes.





        

Gizmo
21 Jan 2025

You won't have any examples with the code builder files that only comes with the old library vs 1.41

I'll make you the examples don't worry just open manually the project and replace the code inside with the one I've posted, the only thing that has to match is your credentials and the light component name as you specify it in the Dev Console

I'll be your 1 on 1 human tutorial...ok :-) It's much faster for me to write you customised code that will work in your setup


Swapfile
21 Jan 2025

When I delete my device from the console and redo everything the code builder does not generate a new websockets2 folder.

So I just keep the last working one in the library and the code does compile.
Swapfile
21 Jan 2025

OK at this stage should I rather use Platform io (I think that was the other option) and dump Arduino ide for now.

I use the Arduino ide for lots of other projects.

Did you make any changes to the websockets2 today , no new device that I created so far connects to the Wi Fi except for your Test example with the websockets2 that I downloaded early this morning.

This is an up hill battle so I rather change to a different compiler than Arduino.
Gizmo
21 Jan 2025

Yes, exactly, the websockets only need to be "installed" once, that's how Arduino IDE wants it and that's one of the reasons why shit breaks down

Look, how about a quick 30 min video session later today? I have a ton of work at the moment but I don't have any one else needing assistance right now so I can spare half an hour no problems and I can guide with screen sharing.
Normally I would use Google meet as it's free and it will be quicker to explain things with voice rather than typing long messages (if you are shy can keep your camera off, I respect everyone's privacy)

Gizmo
21 Jan 2025

sorry, I've posted the last message without seeing your previous one

Yes PlatformIO is a much much better option in general.

Anyways, I've just got rid of a client on the phone so I am pretty much available any time today
Gizmo
21 Jan 2025

If you don't mind trying PlatformIO then everything will work out of the box even the tutorial projects as they are with the old lib 1.41
The code builder stuff is also completely self contained as a single PlatformIO project without dependencies
Swapfile
21 Jan 2025

Ahhhhh.. now I must learn something new from scratch , I will rather do that than keep on messing with the Arduino ide here.

So , have a lovely day , I will not bother you for the next few hour (maybe a day or 2).

Thanks for your expert help and advice.
Gizmo
21 Jan 2025

lol...cool stuff, more knowledge never hurts and you may actually like PlatformIO (it's a hell of a lot faster and more flexible)

Anywho, I've checked and for your board (or pretty much all 32 wroom) the correct board to pick in the list code builder list should be "ESP32DEV".
I have an ESP32 Wroom 32D and that's the board profile that I use.

I've just remembered I've made a quick video for another ChipChop user showing the basic process with Code Builder and platformIO, have a look here: https://www.youtube.com/watch?v=ADc653q3Z-Y

The only additional thing to the video is to upload the code to the ESP you press the little arrow in the bottom menu (in the video I am pressing the "tick" which is just compile, the arrow next to to it is the "upload"

Finally, the main ".ino" file is in the "src" folder and it's called "main.cpp"

Keep me posted

Swapfile
21 Jan 2025

Thanks , I opened a new post regarding Platform io.

The new Platform io is very different from your Tutorial.

I opened the post before I saw the video link .. thanks.

Not as strait forward as I thought.