Skip to content

Commit 046df65

Browse files
Add network, wireless, wireless AP and certificates deployment (#313)
Co-authored-by: José Simões <[email protected]>
1 parent 138f7d1 commit 046df65

File tree

11 files changed

+1225
-146
lines changed

11 files changed

+1225
-146
lines changed

README.md

Lines changed: 239 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,245 @@ In that case, the `SerialPort` must be present in the JSON file.
503503
>
504504
> If a file can't be uploaded because of a problem, the deployment of the other files will continue and an error will be displayed.
505505
506+
## Deploy Wireless, Wireless Access Point, Ethernet configuration and Certificates
507+
508+
You can upload Wireless, Wireless Access Point, Ethernet configurations and Certificates during the flash operation so that your device is ready to go and those elements do not need to be stored in the code or beforehand in the internal storage. Depending on your device, some options may not be available. So check out what is available on your device before trying to upload them. The `--networkdeployment` can be combined with any other option.
509+
510+
```console
511+
nanoff --networkdeployment C:\path\deploy.json
512+
```
513+
514+
The json file can contains various configurations and thet are all optional:
515+
516+
```json
517+
{
518+
"serialport":"COM42",
519+
"WirelessClient": { },
520+
"WirelessAccessPoint": { },
521+
"Ethernet": { },
522+
// Only one or the other can be used
523+
"DeviceCertificates": "base64",
524+
"DeviceCertificatesPath": "c:\\pathto\\cert.pem",
525+
// Only one or the other can be used
526+
"CACertificates": "base64",
527+
"CACertificatesPath": "c:\\pathto\\certca.pem"
528+
}
529+
```
530+
531+
The optional `SerialPort` can be used in case the port to upload the configurations is different than the one to flash the device or not specified in the main command line like in the previous example.
532+
533+
Here is a minimal example setting up a Wireless Client and a Wireless Access Point configuration at the same time:
534+
535+
```json
536+
{"SerialPort":"COM10","WirelessClient":{"SSID":"MySSID","Password":"the_secret_password"},"WirelessAccessPoint":{"SSID":"nanoDevice","Password":null,"IPv4Address":"192.168.10.1","IPv4NetMAsk":"255.255.255.0","Authentication":"None"}}
537+
```
538+
539+
See the section further to understand what are the mandatory fields and which ones are optionals.
540+
541+
### Wireless Client options
542+
543+
The `WirelessClient` object represents the wireless configuration settings for a network deployment. It contains the following properties:
544+
545+
- **Ssid**:
546+
- Type: `string`
547+
- Format: 32 characters maximum.
548+
- Mandatory
549+
550+
- **Password**:
551+
- Type: `string`
552+
- Format: 64 characters maximum
553+
- Default: empty string meaning no password.
554+
- Optional
555+
556+
- **Authentication**
557+
- Type: `string`
558+
- Possible values (case insensitive): `EAP, PEAP, WCN, OPEN, SHARED, WEP, WPA, WPA2, NONE`
559+
- Description: the authentication type.
560+
- Default: if nothing is specified, the internal value is not going to be changed
561+
562+
- **Encryption**
563+
- Type `string`
564+
- Possible values (case insensitive): `WEP, WPA, WPA2, WPA_PSK, WPA2_PSK2, Certificate, None`
565+
- Description: the encryption type.
566+
- Default: if nothing is specified, the internal value is not going to be changed
567+
568+
- **ConfigurationOption**
569+
- Type: `string`
570+
- Possible values (case insensitive): `None, Disable, Enable, AutoConnect, SmartConfig`
571+
- Description: the configuration option.
572+
- Default: if nothing is specified, the internal value is not going to be changed
573+
574+
- **RadioType**
575+
- Type: `string`
576+
- Possible values (case insensitive): `802.11a, 802.11b, 802.11g, 802.11n`
577+
- Description: the radio type.
578+
- Default: if nothing is specified, the internal value is not going to be changed
579+
580+
- **DhcpEnabled**:
581+
- Type: `bool`
582+
- Default: true
583+
- Optional
584+
- Description: a value indicating whether DHCP is enabled. If set to `false`, the `IPv4Address` and `IPv4NetMask` need to be set up.
585+
586+
- **AutomaticDNS**:
587+
- Type: `bool`
588+
- Default: true
589+
- Optional
590+
- Description: a value indicating whether automatic DNS is enabled. If set to `false`, `Ipv4DNSAddress1` needs at least to be set.
591+
592+
- **IPv4Address**:
593+
- Type: `string`
594+
- Format: `1.2.3.4` where 1, 2, 3 and 4 are bytes with values from 0 to 255.
595+
- Description: the IPv4 address. This needs to be set if `DhcpEnabled` is `false`.
596+
597+
- **IPv4NetMask**:
598+
- Type: `string`
599+
- Format: `1.2.3.4` where 1, 2, 3 and 4 are bytes with values from 0 to 255.
600+
- Description: the IPv4 netmask. This needs to be set if `DhcpEnabled` is `false`.
601+
602+
- **IPv4Gateway**:
603+
- Type: `string`
604+
- Format: `1.2.3.4` where 1, 2, 3 and 4 are bytes with values from 0 to 255.
605+
- Description: the IPv4 gateway.
606+
607+
- **IPv4DNSAddress1**:
608+
- Type: `string`
609+
- Format: `1.2.3.4` where 1, 2, 3 and 4 are bytes with values from 0 to 255.
610+
- Description: the primary IPv4 DNS address.
611+
612+
- **IPv4DNSAddress2**:
613+
- Type: `string`
614+
- Format: `1.2.3.4` where 1, 2, 3 and 4 are bytes with values from 0 to 255.
615+
- Description: the secondary IPv4 DNS address.
616+
617+
- **MacAddress**:
618+
- Type: `string`
619+
- Format: `AABBCCDDEEFF` or `AA:BB:CC:DD:EE:FF`
620+
- Description: the MAC address.
621+
- Note: some devivces do not allow to be set up, please check your device first.
622+
623+
### Wireless Access Point options
624+
625+
- **Ssid**:
626+
- Type: `string`
627+
- Format: 32 characters maximum.
628+
- Mandatory
629+
630+
- **Password**:
631+
- Type: `string`
632+
- Format: 64 characters maximum
633+
- Default: empty string meaning no password.
634+
- Optional
635+
636+
- **Authentication**
637+
- Type: `string`
638+
- Possible values (case insensitive): `EAP, PEAP, WCN, OPEN, SHARED, WEP, WPA, WPA2, NONE`
639+
- Description: the authentication type.
640+
- Default: if nothing is specified, the internal value is not going to be changed
641+
642+
- **Encryption**
643+
- Type `string`
644+
- Possible values (case insensitive): `WEP, WPA, WPA2, WPA_PSK, WPA2_PSK2, Certificate, None`
645+
- Description: the encryption type.
646+
- Default: if nothing is specified, the internal value is not going to be changed
647+
648+
- **ConfigurationOption**
649+
- Type: `string`
650+
- Possible values (case insensitive): `None, Disable, Enable, AutoConnect, SmartConfig`
651+
- Description: the configuration option.
652+
- Default: if nothing is specified, the internal value is not going to be changed
653+
654+
- **RadioType**
655+
- Type: `string`
656+
- Possible values (case insensitive): `802.11a, 802.11b, 802.11g, 802.11n`
657+
- Description: the radio type.
658+
- Default: if nothing is specified, the internal value is not going to be changed
659+
660+
- **IPv4Address**:
661+
- Type: `string`
662+
- Format: `1.2.3.4` where 1, 2, 3 and 4 are bytes with values from 0 to 255.
663+
- Description: the IPv4 address.
664+
- Mandatory.
665+
666+
- **IPv4NetMask**:
667+
- Type: `string`
668+
- Format: `1.2.3.4` where 1, 2, 3 and 4 are bytes with values from 0 to 255.
669+
- Description: the IPv4 netmask.
670+
- Mandatory.
671+
672+
- **IPv4Gateway**:
673+
- Type: `string`
674+
- Format: `1.2.3.4` where 1, 2, 3 and 4 are bytes with values from 0 to 255.
675+
- Description: the IPv4 gateway.
676+
- Default: the `IPv4Address` value
677+
678+
- **IPv4DNSAddress1**:
679+
- Type: `string`
680+
- Format: `1.2.3.4` where 1, 2, 3 and 4 are bytes with values from 0 to 255.
681+
- Description: the primary IPv4 DNS address.
682+
683+
- **IPv4DNSAddress2**:
684+
- Type: `string`
685+
- Format: `1.2.3.4` where 1, 2, 3 and 4 are bytes with values from 0 to 255.
686+
- Description: the secondary IPv4 DNS address.
687+
688+
- **MacAddress**:
689+
- Type: `string`
690+
- Format: `AABBCCDDEEFF` or `AA:BB:CC:DD:EE:FF`
691+
- Description: the MAC address.
692+
- Note: some devivces do not allow to be set up, please check your device first.
693+
694+
### Ethernet options
695+
696+
Represents an Ethernet configuration and here are the properties:
697+
698+
- **DhcpEnabled**:
699+
- Type: `bool`
700+
- Default: true
701+
- Optional
702+
- Description: a value indicating whether DHCP is enabled. If set to `false`, the `IPv4Address` and `IPv4NetMask` need to be set up.
703+
704+
- **AutomaticDNS**:
705+
- Type: `bool`
706+
- Default: true
707+
- Optional
708+
- Description: a value indicating whether automatic DNS is enabled. If set to `false`, `Ipv4DNSAddress1` needs at least to be set.
709+
710+
- **IPv4Address**:
711+
- Type: `string`
712+
- Format: `1.2.3.4` where 1, 2, 3 and 4 are bytes with values from 0 to 255.
713+
- Description: the IPv4 address. This needs to be set if `DhcpEnabled` is `false`.
714+
715+
- **IPv4NetMask**:
716+
- Type: `string`
717+
- Format: `1.2.3.4` where 1, 2, 3 and 4 are bytes with values from 0 to 255.
718+
- Description: the IPv4 netmask. This needs to be set if `DhcpEnabled` is `false`.
719+
720+
- **IPv4Gateway**:
721+
- Type: `string`
722+
- Format: `1.2.3.4` where 1, 2, 3 and 4 are bytes with values from 0 to 255.
723+
- Description: the IPv4 gateway.
724+
725+
- **IPv4DNSAddress1**:
726+
- Type: `string`
727+
- Format: `1.2.3.4` where 1, 2, 3 and 4 are bytes with values from 0 to 255.
728+
- Description: the primary IPv4 DNS address.
729+
730+
- **IPv4DNSAddress2**:
731+
- Type: `string`
732+
- Format: `1.2.3.4` where 1, 2, 3 and 4 are bytes with values from 0 to 255.
733+
- Description: the secondary IPv4 DNS address.
734+
735+
- **MacAddress**:
736+
- Type: `string`
737+
- Format: `AABBCCDDEEFF` or `AA:BB:CC:DD:EE:FF`
738+
- Description: the MAC address.
739+
- Note: some devivces do not allow to be set up, please check your device first.
740+
741+
### Device and CA Certificates
742+
743+
You can either **base64** encode your certificates (`DeviceCertificates` and `CACertificates`) or provide a path on a certificate file (`DeviceCertificatesPath` and `CACertificatesPath`). Note that the certificate file can contain multiple certificates one after the other. This is especially usefull for CA certificates.
744+
506745
## Clear cache location
507746

508747
If needed one can clear the local cache from the firmware packages that are stored there.

0 commit comments

Comments
 (0)