Hey everyone,
This is my first post and I am still undecided if I should try to bite off more than I can chew with the following project:
I recently acquired a Snapmaker Air Purifier. I also pre-ordered a snapmaker ray, but am not sure if I’ll still cancel the laser machine due to the newly announced xtool S1. I also have an older, lower power laser engraver/cutter and had to sadly realise the Snapmaker air purifier has no way of control (not even on/off) without a main snapmaker device, effectlively making this device (so far) useless for any machine aside from snapmaker’s. The website of the Snapmaker Air purifier kind of hints at this, but well… Might be a questionable choice to limit what is effectively a glorified fan so much to snapmakers devices, but no point on dwelling on this!
So what would any insane person do? Think about building a controller for the air purifier so it can be used for a variety of use cases
Therefore, I have spent the past few days reading up about all the great minds in this forum that have attempted to build custom add-ons and modules that can communicate with the snapmaker eco-system:
@Streupfeffer’s Poking around in CAN Bus
@Streupfeffer’s Custom Extension Module
@Ronin’s DIY enclosure controller - prototype on Arduino
@mpi’s DIY Emergency Stop Button
@brvdboss’s 3D touch probe connected to can bus
and many more…
Thanks to all for the inspiring threads, posts, and updates without which I would have never considered starting this project!
While I could just use the brute force method and bypass the air purifiers electronics and use pwm to control the fan with an arduino, I would prefer a controller (possibly esp32 based) that communicates over CAN (the 4 Pin CAN Bus the add-ons use) and can also read out filter status (possibly connected to the smart home and/or with a small display). An added bonus to the non-invasive mode would be the cool looking front lights of the device would remain and the device would be untouched (warranty and all).
Sadly, my coding skills are quite a bit more limited than my hands on crafting skills, while I have been successfully tinkering with small projects with arduino and esp for a few years. This is my first delve into CAN. I am confident that I would achieve the ESP/Arduino implementation if or when the CAN messages are known to me.
I was quite excited when I came accross @Ronin’s P.S. in the following post: DIY enclosure controller - prototype on Arduino - #6 by Ronin. Sadly, I have so far not found the hinted at article/tutorial about the snapmaker CAN codes and therefore suspect that it is still unposted at 80% finished
Anyways, I have purchased a USB CAN Bus adapter (USBtin) to try to communicate with the machine. One thing to note: It appears as if @Streupfeffer’s pin-schematic here wrongly refers to the 24V pin as longer. In accordance to @Ronin’s Image in this post, my longer pin in the add-on cable is directly connected to Gnd. When connecting up the USBtin, however, I do not get any messages from the air purifier. Most likely, it is just waiting for the controller to initiate communication?
I have tried to understand the Snapmaker controller github code (yay - open source ^^). However, that’s where my limited coding experience restircts my understanding… The Snapmaker-Controller/snapmaker/src/module/module_base.h shows a ModuleDeviceID (MODULE_DEVICE_ID_PURIFIER) of 7 and ModuleFonctionIDs of 23 for MODULE_FUNC_SET_PURIFIER and 24 for MODULE_FUNC_REPORT_PURIFIER for the air purifier. Sadly, this does not yet get me the CAN messages or even message IDs.
Therefore, my questions to all the great minds of this forum:
- What is the baud rate of the snapmaker 4Pin CAN Bus? Are the 500Kbps in @Streupfeffer’s screenshot of this post correct?
- Can anyone tell me the CAN ID of the Snapmaker Air Purifier?
- Does someone know the kind of message data/length the module expects for an initial handshake/requesting data/setting fan speeds? Possibly even the full message structures of the communication?
Sadly, I cannot do a full network sniff, as I do not have a Snapmaker main machine and am not even sure anymore if I want one
Anywho, thanks to everyone for reading so far and I would greatly appreciate any support during this project - I fear the project won’t be able to come to life without a little help… Thanks in advance!
Cheers and best regards from Germany,
Nils