Arduino Cloud Agent error on MacOS Sonoma

Hello, I am trying to connect my Arduino UNO R4 Wifi board using Arduino Cloud Agent but said program shows an error, could someone help me correct it?

I'm using MacOs Sonoma on a Macbook Pro M2.

The message sent to the console is the following:

INFO[0000] using config from default: /Users/joseguillermovaldezbesares/Library/Application Support/ArduinoCreateAgent/config.ini 
INFO[0000] Checking if the Arduino certificate is in the keychain 
INFO[0000] Retrieving default browser name              
INFO[0000] additional config file not found in config.ini 
INFO[0000] Version:1.6.0                                
INFO[0000] Hostname: MacBook-Pro-de-Jose.local          
INFO[0000] Garbage collection is on using Standard mode, meaning we just let Golang determine when to garbage collect. 
INFO[0000] You specified a serial port regular expression filter: usb|acm|com 
INFO[0000] the autostart file /Users/joseguillermovaldezbesares/Library/LaunchAgents/ArduinoCreateAgent.plist already exists: nothing to do 
[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.
 - using env:	export GIN_MODE=release
 - using code:	gin.SetMode(gin.ReleaseMode)

[GIN-debug] GET    /                         --> main.homeHandler (2 handlers)
[GIN-debug] POST   /upload                   --> main.uploadHandler (2 handlers)
[GIN-debug] GET    /socket.io/               --> main.(*WsServer).ServeHTTP-fm (2 handlers)
[GIN-debug] POST   /socket.io/               --> main.(*WsServer).ServeHTTP-fm (2 handlers)
[GIN-debug] WS     /socket.io/               --> main.(*WsServer).ServeHTTP-fm (2 handlers)
[GIN-debug] WSS    /socket.io/               --> main.(*WsServer).ServeHTTP-fm (2 handlers)
[GIN-debug] GET    /info                     --> main.infoHandler (2 handlers)
[GIN-debug] POST   /pause                    --> main.pauseHandler (2 handlers)
[GIN-debug] POST   /update                   --> main.updateHandler (2 handlers)
[GIN-debug] GET    /v2/*path                 --> main.loop.WrapH.func4 (2 handlers)
[GIN-debug] POST   /v2/*path                 --> main.loop.WrapH.func4 (2 handlers)
[GIN-debug] PUT    /v2/*path                 --> main.loop.WrapH.func4 (2 handlers)
[GIN-debug] PATCH  /v2/*path                 --> main.loop.WrapH.func4 (2 handlers)
[GIN-debug] HEAD   /v2/*path                 --> main.loop.WrapH.func4 (2 handlers)
[GIN-debug] OPTIONS /v2/*path                 --> main.loop.WrapH.func4 (2 handlers)
[GIN-debug] DELETE /v2/*path                 --> main.loop.WrapH.func4 (2 handlers)
[GIN-debug] CONNECT /v2/*path                 --> main.loop.WrapH.func4 (2 handlers)
[GIN-debug] TRACE  /v2/*path                 --> main.loop.WrapH.func4 (2 handlers)
[GIN-debug] [WARNING] You trusted all proxies, this is NOT safe. We recommend you to set a value.
Please check https://pkg.go.dev/github.com/gin-gonic/gin#readme-don-t-trust-all-proxies for details.
[GIN-debug] Listening and serving HTTP on 127.0.0.1:8991
ERRO[0000] Could not find HTTPS certificate. Using plain HTTP only. 
ERRO[0000] Error downloading serial-discovery: invalid character 'y' after top-level value 
panic: invalid character 'y' after top-level value

goroutine 21 [running]:
main.(*SerialPortList).runSerialDiscovery(0x0?)
	/Users/runner/work/arduino-create-agent/arduino-create-agent/serial.go:130 +0x568
main.(*SerialPortList).Run(0x1?)
	/Users/runner/work/arduino-create-agent/arduino-create-agent/serial.go:118 +0x2c
created by main.loop in goroutine 9
	/Users/runner/work/arduino-create-agent/arduino-create-agent/main.go:410 +0x1244

I am fairly sure there is a bug with MacOS, maybe search the forum, I saw something earlier today I think.

Hi @jg_valdez_besares. The Arduino Create Agent developers are tracking the bug here:

I apologize for any inconvenience this has caused. Work on a fix is already in progress.

I'll provide instructions you can follow to force Arduino Create Agent to regenerate this file that was corrupted due to the bug. Hopefully this time the file will be created correctly:

  1. Start macOS "Finder".
  2. Navigate to the following folder:
    /Users/<username>
    
    (where <username> is your macOS username)
  3. You should see a folder named .arduino-create. If not, press the Command+Shift+. keyboard shortcut to reveal this hidden folder.
  4. Control-click the sketch folder.
    A context menu will open.
  5. Select "Move to Trash" from the menu.

Now try using Arduino Cloud again, just as you did before. Hopefully this time everything will work as expected.


Please let me know if you have any questions or problems while following those instructions.

Hi,

Thanks for the quick response and the steps to try and resolve the issue.

I followed the instructions and navigated to the .arduino-create folder (step 4), but I couldn't find the "sketch" folder within it. I'm wondering if there's anything else I can try or if this might indicate a different problem.

Any additional guidance would be greatly appreciated.

Thanks,
jg_valdez_besares

What made you think you were supposed to find a "sketch" folder within it? I never said anything like that.

Please carefully follow the instructions I provided. If there is something you don't understand or you get stuck along the way, just let me know and I'll help out.

1 Like

I've resolved the issue. A malformed JSON file, specifically the "installed.json" file, was the root cause. The file contained an extra 'y' character that disrupted the JSON syntax. Using , I pinpointed the corrupted section (highlighted in red in the attached image) and removed it.

Upon restarting Arduino Cloud Agent, the problem was resolved. Thank you for your help.

You are welcome. I'm glad it is working now.

Regards,
Per

I have an update to share on this subject: The bug has been fixed and the fix is now released in version 1.6.1 of Arduino Cloud Agent. Arduino Cloud Agent will automatically self-update to the new version the next time you use Arduino Cloud while Arduino Cloud Agent is running.

So Arduino Cloud users will no longer be affected by this problem of the corrupted data file causing Cloud Agent to crash once the update has completed.

For anyone who is not able to accomplish the update due to 1.6.0 crashing from the corrupted file, you can manually install 1.6.1 (which will update 1.6.0). The installer can be downloaded from the links listed under the Assets section of the release page:

https://github.com/arduino/arduino-create-agent/releases/latest

1 Like

A post was split to a new topic: UNO R4 WiFi Device creation fails: "We could not find any Arduino device"