This guide explores some of advanced PhyOS features that address real-world challenges developers face when building edge-based solutions and digital experiences.
๐งโ๐ป Enabling Developer Mode
Developer Mode allows you to directly deploy and test your apps on the device without building and publishing them to the Console first. This feature significantly accelerates the development workflow by enabling rapid iteration and real-time debugging capabilities.
Benefits of Developer Mode:
- Deploy code changes directly to your device
- Iterate faster with immediate code deployment and testing
- Test instantly without waiting for build processes
โ ๏ธ Important: Developer Mode should never be enabled on production devices. To disable Developer Mode, you must re-provision your device before deploying it to a production environment.
To enable Developer Mode on your device:
phy dev shell <device-name>
Once connected to the device:
-
Press
Enter
to bring up the interactive menu -
Select
Advanced
and pressEnter
-
Select
Enable Developer Mode
and pressEnter
-
Choose from the following authentication methods:
Option 1: Set Custom Password
- Select
Set Password
and pressEnter
- Enter a custom password when prompted
- Confirm the password to complete setup
Option 2: SSH Public Key Authentication (Recommended)
- Select
Provide SSH public key
and pressEnter
- Paste your public SSH key when prompted
- This method provides enhanced security and convenience
Option 3: Default Password
- Select
Use default password (123)
and pressEnter
- Uses the default password "123"
- Select
Note: If you don't have an SSH public key, you can generate one using the following commands:
macOS:
# Generate SSH key pair
ssh-keygen -t rsa -b 4096 -C "[email protected]"
# Display the public key to copy
cat ~/.ssh/id_rsa.pub
Windows (PowerShell):
# Generate SSH key pair
ssh-keygen -t rsa -b 4096 -C "[email protected]"
# Display the public key to copy
Get-Content ~/.ssh/id_rsa.pub
Linux:
# Generate SSH key pair
ssh-keygen -t rsa -b 4096 -C "[email protected]"
# Display the public key to copy
cat ~/.ssh/id_rsa.pub
๐ Proxy Settings
All PhyOS devices connect to a regional platform proxy for security and simplified network configuration on-site. This default setup is recommended for optimal performance and ease of deployment. However, this may not be possible in corporate environments with mandatory proxy requirements or specific compliance and security policies.
In these cases, you can configure PhyOS devices to connect to another proxy to maintain compliance with mandatory network policies.
Important: Your custom proxy must allow traffic to the Phygrid platform. For specific network configuration requirements, contact [email protected].
Setting Up Custom Proxy
To configure a custom proxy on your PhyOS device, connect to your device:
phy dev shell <device-name>
Once connected to the device:
- Press
Enter
to bring up the interactive menu - Select
Advanced
and pressEnter
- Select
Set Custom Proxy
and pressEnter
- Select
Set proxy settings
and pressEnter
- Provide the following proxy configuration details:
- Hostname: Enter the proxy server hostname or IP address
- Port: Enter the proxy server port number (typically 8080, 3128, or 8888)
- Username: Enter your proxy authentication username
- Password: Enter your proxy authentication password
Important Considerations:
- Verify authentication credentials with your network administrator
- Some proxy configurations may require additional certificates related configuration - see Certificate Authority (CA) Configuration section
Verifying Proxy Configuration
To verify your custom proxy configuration is working correctly, test connectivity by running the following command in the device shell:
curl -v https://<hostname>
Choose a hostname that supports HTTPS and is accessible through your proxy configuration.
What to look for:
* Uses proxy env variable https_proxy == 'http://proxy_username:proxy_password@<hostname>:<port>'
This output line confirms that your proxy configuration is active and being used by the system.
Successful Proxy Indicators:
- The command completes without connection errors
- You see the proxy environment variable being used
If you see this output, your custom proxy configuration is working correctly and all traffic from your PhyOS device will route through the specified proxy server.
Resetting Proxy Settings
To remove custom proxy settings and restore default proxy configuration:
- In the interactive menu, select
Advanced
- Select
Set Custom Proxy
and pressEnter
- Select
Clear proxy settings
and pressEnter
๐ก Tip: Always test your proxy configuration in a development environment before deploying to production devices. Incorrect proxy settings can prevent your device from connecting to Phygrid services.
๐ Certificate Authority (CA) Configuration
When using a custom proxy that performs SSL/TLS inspection, you may need to install custom CA certificates on the device to ensure proper certificate validation for HTTPS connections.
Adding CA Certificates
To configure custom Certificate Authority certificates on your PhyOS device:
phy dev shell <device-name>
Once connected to the device:
-
Press
Enter
to bring up the interactive menu -
Select
Advanced
and pressEnter
-
Select
CA (add certificate authority trust)
and pressEnter
-
Enter the URL of the CA certificates when prompted
-
Specify whether you need to use a proxy to download the certificate:
Option 1: Direct Download (No Proxy)
- Enter
n
when asked "Do you need to use a proxy to download the certificate?" - The system will download and install the CA certificates directly
Option 2: Proxy-Assisted Download
- Enter
y
when asked "Do you need to use a proxy to download the certificate?" - Provide the following proxy configuration details:
- Hostname: Enter the proxy server hostname or IP address for certificate download
- Port: Enter the proxy server port number (typically 8080, 3128, or 8888)
- Username: Enter your proxy authentication username (optional)
- Password: Enter your proxy authentication password (optional)
- Enter
Certificate URL Formats
The CA certificate URL should point to a valid certificate file or certificate bundle. Common formats include:
- PEM Format:
https://your-ca-server.com/ca-certificate.pem
- CRT Format:
https://your-ca-server.com/ca-certificate.crt
- Certificate Bundle:
https://your-ca-server.com/ca-bundle.crt
Verification
After adding CA certificates, verify they are working as expected:
curl -v https://<hostname>
Choose a hostname that supports HTTPS and is accessible through your proxy configuration.
โ ๏ธ Security Note: Only add CA certificates from trusted sources. Adding untrusted certificates can compromise the security of your device and network communications.