-
Notifications
You must be signed in to change notification settings - Fork 7
Nerlnet App Flow
all communication in Nerlnet is HTTP based. if an entity wants to communicate with another, it must call nerl_tools:sendHTTP/4 which generates a new HTTP request using httpc:request. the relevant entity will get and handle the request in the appropriate handler.
After install and build of the platform, you can run the NerlnetRun.sh to start the app.
This will start the Nerlnet app, which waits for an initiator to tell it what entities this device needs to open.
The Nerlnet app open its own cowboy server (open in IP:8484), which has several handlers:
- IoT handler: query to this page will return whether this app has an active nerlnet model
- json handler: gets the arch and conn jsons that initialize the app and its entities on device
after initiator was received (from json handler), can proceed
arch and conn jsons are received and read by jsonParser module. This module saves the data in an ets named "nerlnet_data" that entities have access to.
afterwards, the main app opens all entities on the device.
after all entities and their servers have opened, they are all ready to get messages from the api server (thru the main server).
This concludes that init stage.
before an experiment (or training/predication phase) can start, the relevant data needs to be uploaded to the sources. This is done thru specific handlers that read the CSV and pass it along. When the data reaches the source, it loads it and waits for a start casting message.
Stage 1: mainserver tells clients to go to appropriate state. Clients make sure all workers are ready, and send back ACK to mainserver
Stage 2: mainserver sends start casting to all sensors. they send data at Frequency Hz to relevant workers.
Stage 3: workers get sample thru clients and train/predict according to phase.
Stage 4: when source sends all data / the amount set for experiment, it sends ACK back to mainserver.
Stage 5: mainserver tells clients to go to idle (?)