This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
sdk:sdk [2017/04/27 07:14] – [Helpful Functions] juraschek | sdk:sdk [2024/01/11 09:07] – [The Language] dodenhoeft | ||
---|---|---|---|
Line 5: | Line 5: | ||
- A NetModule-specific Application Programming Interface (API), which ships with a comprehensive set of functions for accessing hardware interfaces (e.g. digital IO ports, GPS, external storage media, serial ports) but also for retrieving system status parameters, sending E-Mail or SMS messages or simply just to configure the router. | - A NetModule-specific Application Programming Interface (API), which ships with a comprehensive set of functions for accessing hardware interfaces (e.g. digital IO ports, GPS, external storage media, serial ports) but also for retrieving system status parameters, sending E-Mail or SMS messages or simply just to configure the router. | ||
- | Anyone, reasonably experienced in the C language, will find an environment that is easy to dig in. However, feel free to contact us via [[router@support.netmodule.com]] and we will happily support you in finding a programming solution to your specific problem. | + | Anyone, reasonably experienced in the C language, will find an environment that is easy to dig in. However, feel free to contact us via [[support@netmodule.com]] and we will happily support you in finding a programming solution to your specific problem. |
===== The Language ===== | ===== The Language ===== | ||
The arena scripting language offers a broad range of POSIX functions (like printf or open) and provides, together with tailor-made API functions, a simple platform for implementing any sort of applications to interconnect your favourite device or service with the router. | The arena scripting language offers a broad range of POSIX functions (like printf or open) and provides, together with tailor-made API functions, a simple platform for implementing any sort of applications to interconnect your favourite device or service with the router. | ||
Line 14: | Line 14: | ||
* otherwise we 'd have to send a short message . | * otherwise we 'd have to send a short message . | ||
*/ | */ | ||
- | for ( attempts = 0; attempts < 3; attempts ++) { | + | for ( attempts=0; attempts< |
- | if ( nb_serial_read (" serial0 ") == " Knock Knock !") { | + | if ( nb_serial_read (" |
- | nb_serial_write (" serial0 ", "Who 's there ?"); | + | nb_serial_write (" |
- | if ( nb_serial_read (" serial0 ") == " Santa ") { | + | if ( nb_serial_read (" |
printf (" Hurray !\n"); | printf (" Hurray !\n"); | ||
- | nb_dio_set (" out1 ", 1); | + | nb_dio_set (" |
} | } | ||
} | } | ||
} | } | ||
- | nb_sms_send (" +123456789 ", "No presents this year :(") | + | nb_sms_send (" |
</ | </ | ||
- | A set of example scripts can be downloaded directly from the router, you can find a list of them in the appendix. The [[ftp:// | + | A set of example scripts can be downloaded directly from the router, you can find a list of them in the appendix. The [[https:// |
of all available functions. | of all available functions. | ||
Line 55: | Line 55: | ||
- Encode functions (coming soon) | - Encode functions (coming soon) | ||
- Other system-related functions | - Other system-related functions | ||
- | The [[ftp:// | + | The [[https:// |
Please note that some functions require the corresponding services (e.g. E-Mail, SMS) to be properly configured prior to utilizing them in the SDK. Let us now pay some attention to the very powerful API function '' | Please note that some functions require the corresponding services (e.g. E-Mail, SMS) to be properly configured prior to utilizing them in the SDK. Let us now pay some attention to the very powerful API function '' | ||
Line 104: | Line 104: | ||
The SDK host (sdkhost) corresponds to the daemon managing the scripts and their operations and thus avoiding any harm to the system. In terms of resources, it will limit CPU and memory for running scripts and also provide a pre-defined portion of the available flash storage. You may, however, extend it by external USB storage or (depending on your model) SD cards. Files written to /tmp will be hold in memory and will be cleared upon a restart of the script. As your scripts operate in the sandbox, you will have no access to tools on the system (such as '' | The SDK host (sdkhost) corresponds to the daemon managing the scripts and their operations and thus avoiding any harm to the system. In terms of resources, it will limit CPU and memory for running scripts and also provide a pre-defined portion of the available flash storage. You may, however, extend it by external USB storage or (depending on your model) SD cards. Files written to /tmp will be hold in memory and will be cleared upon a restart of the script. As your scripts operate in the sandbox, you will have no access to tools on the system (such as '' | ||
- | ===== Testing ===== | + | ===== Simple How-To & Testing ===== |
* [[sdk: | * [[sdk: | ||
===== Useful SDK Examples ===== | ===== Useful SDK Examples ===== | ||
- | * [[sdk: | + | |
- | | + | ==== Web Manager ==== |
- | * [[sdk: | + | |
- | * [[sdk: | + | |
- | * [[sdk: | + | |
* [[sdk: | * [[sdk: | ||
* [[sdk: | * [[sdk: | ||
+ | * [[sdk: | ||
+ | |||
+ | ==== Configurations ==== | ||
+ | * [[sdk: | ||
+ | * [[sdk: | ||
+ | * [[sdk: | ||
+ | ==== Status Parameters ==== | ||
* [[sdk:: | * [[sdk:: | ||
- | * [[sdk::vpn-supervision|Supervising a VPN Tunnel]] | + | * [[sdk:status-values-via-snmp|Get status values via SNMP]] |
- | * [[sdk::ftp2sms|Forward File Content of Files on FTP Server via SMS]] | + | * [[sdk:status-values-via-snmp# |
* [[sdk:: | * [[sdk:: | ||
- | | + | |
- | * [[sdk:: | + | ==== Supervision ==== |
- | * [[sdk::httpGET| Webservices using HTTP GET]] | + | * [[sdk::vpn-supervision|Supervising |
- | * [[sdk:: | + | |
- | * [[sdk:: | + | |
- | * [[sdk:: | + | |
* [[sdk: | * [[sdk: | ||
* [[sdk: | * [[sdk: | ||
* [[sdk: | * [[sdk: | ||
+ | * [[sdk: | ||
+ | ==== GPS ==== | ||
+ | * [[sdk: | ||
+ | * [[sdk: | ||
+ | |||
+ | ==== Serial ==== | ||
+ | * [[sdk: | ||
+ | * [[sdk:: | ||
+ | * [[sdk:: | ||
+ | * [[sdk:: | ||
+ | * [[sdk:: | ||
+ | ==== HTTP ==== | ||
+ | * [[sdk:: | ||
+ | * [[sdk:: | ||
+ | * [[sdk:: | ||
+ | ==== Modbus ==== | ||
+ | * [[sdk:: | ||
+ | * [[sdk:: | ||
+ | * [[sdk:: | ||
+ | ==== MQTT ==== | ||
+ | * [[sdk:: | ||
+ | * [[sdk:: | ||
+ | * [[sdk:: | ||
+ | ==== Web Services ==== | ||
+ | * [[sdk:: | ||
+ | * [[sdk:: | ||
+ | * [[sdk:: | ||
+ | ==== Wifi / WLAN ==== | ||
+ | * [[sdk:: | ||
+ | * [[sdk:: | ||
+ | ==== Various ==== | ||
+ | * [[sdk: | ||
+ | * [[sdk:: | ||
+ | * [[sdk:: | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
===== Helpful Functions ===== | ===== Helpful Functions ===== | ||
* [[sdk: | * [[sdk: | ||
+ | * [[sdk: | ||
+ | * [[sdk: | ||
Line 148: | Line 191: | ||
|[[sdk: | |[[sdk: | ||
|[[sdk: | |[[sdk: | ||
+ | |[[sdk: | ||
|[[sdk: | |[[sdk: | ||
|[[sdk: | |[[sdk: | ||
Line 194: | Line 238: | ||
|[[sdk: | |[[sdk: | ||
|[[sdk: | |[[sdk: | ||
+ | |||
+ | |||
+ | ===== Access the Filesystem ===== | ||
+ | |||
+ | You can acces the SDK Filesystem externaly via SCP: | ||
+ | |||
+ | With Windows you can use the opensource software [[https:// | ||
+ | |||
+ | Connect with the Protocoal SPC, User " | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | Please then go to the folder | ||
+ | |||
+ | < | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | Where you find the Filesystem which is usable from the SDK | ||
+ | |||
+ | |||
+ | {{ : | ||
+ | |||