diff --git a/docs/MQTT_API.md b/docs/MQTT_API.md new file mode 100644 index 0000000..bcc7695 --- /dev/null +++ b/docs/MQTT_API.md @@ -0,0 +1,270 @@ +# MQTT + +## About + +MQTT is a machine-to-machine (M2M)/"Internet of Things" connectivity protocol. It was designed as an extremely lightweight publish/subscribe messaging transport. It is useful for connections with remote locations where a small code footprint is required and/or network bandwidth is at a premium. + +## MQTT API + +To be able to send MQTT commands to the device, you need to connect and use the following topic: +(All commands will need to be sent here) + +``` +anycubic/anycubicCloud/v1/server/printer/20023//response +``` + +You can find the printer id by taking the first 32 characters of the file: + +``` +/user/ac_mqtt_connect_info +``` + +Then to see received responses from the printer, you need to subscribe to the following topic: + +``` +anycubic/anycubicCloud/v1/printer/public/# +``` + +### Commands + +#### List internal files + +```json +{ + "type": "file", + "action": "listLocal", + "data": { + "path": "/" + } +} +``` + +#### List files on USB + +```json +{ + "type": "file", + "action": "listUdisk", + "data": { + "path": "/" + } +} +``` + +#### Delete internal file + +```json +{ + "type": "file", + "action": "deleteLocal", + "data": { + "path": "dir", + "filename": "filename" + } +} +``` + +#### Delete file on USB + +```json +{ + "type": "file", + "action": "deleteUdisk", + "data": { + "path": "dir", + "filename": "filename" + } +} +``` + +#### cloudRecommendList + +Need more info on what this does + +```json +{ + "type": "cloudRecommendList", + "records" { + "md5": "md5", + "url": "url", + "size": "size", + "img_url": "img_url", + "est_time": "est_time", + } +} +``` + +#### Get printer status + +```json +{ + "type": "status", + "action": "query" +} +``` + +#### Video + +```json +{ + "type": "video", + "action": "startCapture", + "data": { + "region": "region", + "tmpSecretKey": "tmpSecret", + "tmpSecretId": "tmpSecretId", + "sessionToken": "sessionToken" + } +} +``` + +#### Get slice params + +```json +{ + "type": "print", + "action": "getSliceParam" +} +``` + +#### Get printer status + +```json +{ + "type": "print", + "action": "query" +} +``` + +#### localtasktrans + +```json +{ + "type": "print", + "action": "localtasktrans", + "data": { + "taskid": "", + "localtask": "" + } +} +``` + +#### Start print + +```json +{ + "type": "print", + "action": "start", + "data": { + "taskid": "", + "url": "", + "filename": "", + "filesize": "", + "md5": "", + "filetype": "", + "filepath": "", + "project_type": "" + } +} +``` + +#### Pause print + +```json +{ + "type": "print", + "action": "pause", + "data": { + "taskid": "" + } +} +``` + +#### Resume print + +```json +{ + "type": "print", + "action": "resume", + "data": { + "taskid": "" + } +} +``` + +#### Stop print + +```json +{ + "type": "print", + "action": "stop", + "data": { + "taskid": "" + } +} +``` + +#### Update print + +```json +{ + "type": "print", + "action": "update", + "data": { + "taskid": "", + "settings": { + "target_nozzle_temp": "", + "target_hotbed_temp": "", + "fan_speed_pct": "", + "print_speed_mode": "", + "z_comp": "" + } + } +} +``` + +#### Cancel print + +```json +{ + "type": "print", + "action": "cancel", + "data": { + "taskid": "" + } +} +``` + +#### Get ota version + +```json +{ + "type": "ota", + "action": "reportVersion", + "data": { + "force_update": "force_update", + "firmware_md5": "firmware_md5", + "firmware_version": "firmware_version", + "firmware_name": "firmware_name", + "firmware_url": "firmware_url", + "firmware_size": "firmware_size" + } +} +``` + +#### Update ota version + +```json +{ + "type": "ota", + "action": "update", + "data": { + "force_update": "force_update", + "firmware_md5": "firmware_md5", + "firmware_version": "firmware_version", + "firmware_name": "firmware_name", + "firmware_url": "firmware_url", + "firmware_size": "firmware_size" + } +} +``` diff --git a/options.cfg b/options.cfg index e2ec779..1c02e8f 100644 --- a/options.cfg +++ b/options.cfg @@ -5,7 +5,7 @@ # Disable patching an option by using '#' or ';' as a first caracter in the option line # Use single or double quotes for the option value. Do not use spaces inside the quotes. # Use list of values separated by a space if needed because suplicated option are not supported -# In square brackets you may place the name(s) of other option(s) required by a given option. +# In square brackets you may place the name(s) of other option(s) required by a given option. # This will not auto include the required option(s) but will be used to validate the option integrity. #------------------------------------------------------------------------------------------------- @@ -30,7 +30,7 @@ uart="2.3.9" #ssh="dropbear" # Enable opkg (+5MB to the update, +10MB to the rootfs) -#opkg="default" +opkg="default" # Enable Python 3 (+14MB to the update, +25MB to the rootfs) python="3.11" @@ -50,7 +50,7 @@ webcam="default" [python] [fswebcam] # Replace the URL below with the URL of your MQTT server # You also need to transfer to the printer your keys in # the /user folder by ssh as explained in the project page -#kobra_unleashed="localhost.mr-a.de" +kobra_unleashed="localhost.mr-a.de" # Replace some of the app images #app_images="set1" @@ -59,4 +59,4 @@ webcam="default" [python] [fswebcam] #boot_resource="kangaroo" # Add a startup script -#startup_script="startup.sh" +startup_script="startup.sh" diff --git a/temp/.gitkeep b/temp/.gitkeep new file mode 100644 index 0000000..e69de29