I am not sure we are talking about the same thing. I want to do all in a python script. This is now my script. However when running it in the CLI environment it doesnt accept a=$1.
Copying it from the CLI environment doesnt show the entire line for json=$(printf '{"ip":"192.1 .. but this is completely as in your suggestion.
import time
import datetime
import json
import requests
print('hello_world')
print('hello_world2')
presentDate = datetime.datetime.now()
unix_timestamp = round(datetime.datetime.timestamp(presentDate)*1000)
print(unix_timestamp)
a=$1
b=$2
c=$3
json=$(printf '{"ip":"192.168.178.80","port":502,"id":1,"timeout":1,"function":3,"first_reg":%d,"reg_count":"%s","data_type":"%s","
ubus call modbus_master tcp.test "$json"