Skip to content

Rfc0012 configuration file#10

Draft
Ahelsamahy wants to merge 220 commits intomasterfrom
RFC0012_ConfigurationFile
Draft

Rfc0012 configuration file#10
Ahelsamahy wants to merge 220 commits intomasterfrom
RFC0012_ConfigurationFile

Conversation

@Ahelsamahy
Copy link
Collaborator

Create a robot configuration file that works as a connection between segments in a robot line.

The robot_config.ini would solve the problem of:
-Changing the IP of segment in each release
-Connection between v number and the segment
-Store the data related to the segment, such s IP number and MAC address

There are other two functions but they were created by Berna
Router class to get the SSID and other two functions but they were created by Berna.
Camera class has one function to get the ip of camera
The function returns JSON sorted incrementally for the ips of connected devices to the segments robot
The body was using a class just for it, which I removed.
Moved the style to separated file .css
…the data

The functions scan for all discoverable networks, returns a filtered JSON for the data after replacing the unknown data from IE information with one that is known based on the data in it. There is DocString for each new function.
I don't think it is thread safe, will check this with local mode
There is one pretty debugger with indentation and another one just for IP and MAC.

It turns out the function was thread safe already.
There were lots of files in the root of JS folder
I replaced the functions with other use that is related to them. They would need IP tables from Teleop service now
The changes include rover and CARLA. The function has been tested on local mode only
also changed all the calls that were related to user configuration file, to also include robot configuration file
Will take different approach from the used one in JQuery. I will load html file then populate it. The one used was to create all the elements in the page using JQuery
The amount of template pages to load was getting more and more, and it wasn't handy to make a function for each.
The is working on both touch and normal screen
exclude the header from being changed
There are 4 functions (extract_security_info, parse_ie_data, parse_iwlist_output, fetch_wifi_networks) that were always tied together. I made them as one class which gets the call from main class "Router" to return scanned networks.
The function takes new network's mac, name and password. Tested on local mode 5Earl
The new function is called "delete_network"
as the function will do one thing, then there is no need to give the function as a parameter to it.
Will need to change it in the call in mobile controller
included part is in the DocString for the function
so it would be easier to tell what IP is related to what part. Made it for Segment cooperation team
…emplates

The location is changed so I can run a live server from /html folder and it would align to where the static files are served in Tornado
To eliminate the extra touches from the user to deal with user settings once the load the user menu
it is now relative file navigation rather absolute path
instead of assigning the call for it in for loop for each row. This would save some load
…utton

the data for wifi-name wasn't correctly assigned for each row, because of the interpolation of var inside the string with trinary if condition
it will return the ip of target router that has a network behind it. in 5Earl with 4Davide, it will return 192.168.1.0
…with period

it will take period in secs, function and quit event
it runs every 60 seconds and it will check if there is a static route then print the ip of nano that would correspond to this route
@Ahelsamahy Ahelsamahy mentioned this pull request Feb 27, 2024
As I want the app.py of all services to have minimal setup of the main function and the main application. I will do that while working on other features
@Ahelsamahy Ahelsamahy self-assigned this Oct 18, 2024
When I was working on this feature previously, VEH had python 2.7. Later along the dev process, I made a new docker image with a higher python image.

As VEH is dealing with the configuration file, it makes sense to have it also doing the robot configuration file and populate it
After changing the directories tree in the previous isse of common file, I had to update the commons folder in the docker image of coms
that will be used to populate the robot config file
before tornado endpoints starts
brought to you by the creator of last 4 commits with the same name
that would check if the config exists, if not, it will add it from the template. After adding the file, it will populate it if the segment isn't a part of the current robot
Added the new robot ui menu along with the needed navigation points that are needed to make it work. Added also styles for the new components and got Massy's feedback on how the layout should be. Will implement these points later when I get to finish the implementation of connection
…changing config files

Teltonika has a UCI (unified command interface) that can be used to make changes to the config files (wireless, network and firewall) without the need to change the files directly. My older appraoch was changing the files directly and didn't use the UCI.

I opted to partially use the UCI in most of the connections but not in all, as being done in the firewall configs. I couldn't use add_list to work on the same line, so instead i used my old approach when dealing with the firewall file on both routers

Has been tested on Earl and Frank back and forth and working fine
@Ahelsamahy
Copy link
Collaborator Author

The script to make the connection is working fine without the need to make a static route on both routers.
image
It takes relatively long time, but this is instead of restarting the two routers

Add styles to work on light and dark theme. Will add loading style later along the page
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant