Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Would it be possible to use the I2C interface instead of the SPI interface? #15

Open
pzw001 opened this issue Dec 29, 2024 · 6 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@pzw001
Copy link

pzw001 commented Dec 29, 2024

Hello,

I am very interested in your project, and am currently looking at the creation of a PCB which will include everything needed in a nice organized manner. My goal would be at this moment to use the project for my 2 AMS units, so I would need 8 (4 if I can get them to read at both sides ;-) ) or 9 (5) readers. I see that the current solution is to use designated IO pins for the CS signals, which is the easiest / quickest way. But there might be easier options using the I2C interface instead. (Especially with 8 or more readers connected). The goal I set for myself is to get the PCB to fit in one of the openings in the AMS enclosure, so it looks like a nice finished unit.

I would be happy to share my PCB design with the community, once all the possible issues have been resolved.

It might be best to discuss this in an email message instead. Please let me know.

Thanks
Paul

@spuder
Copy link
Owner

spuder commented Dec 29, 2024

Hi thanks for reaching out.

So I understand you have 2 AMS and you want to design a PCB that supports 8 readers.

Your help would be greatly appreciated. Here is the current status:

PCB

I have a hand soldered prototype that supports 5 readers. It uses a more powerful esp32-s3. I've also sourced the exact molex connectors that the AMS uses so it could be powered from the 24v from the printer instead of USB.
Designs are in EasyEda. I can invite you to the project.

3d prints

There is an experimental 3d printed insert that fits inside an AMS. It uses DuPont connectors but likely it should be changed to JST connectors. Appropriate cables would need to be sourced.
There is a 60mm cutout in the back where it would fit well.

SPI/i2c

I2c is a good idea, however it's not feasible for the project for a couple of reasons.

  1. Every pn532 that is sourced has a hard coded 0x42 address with no way to change it without a hardware multiplexer.
  2. Clock stretching
    I tried for many days to get i2c working with no luck. I found several of people having the same problems. Those who did get it working found it unreliable. The pn532 uses clock stretching which the Esphome library doesn't support.

Since the p1/x1 support up to 17 spools, the preferred design will probably be to have 1x esp32 per AMS and use a CANBUS or wireless link between them, where one of them is the dedicated mqtt client since the P1 (and possibly the x1) have a limit of 4 mqtt clients. More prototypes are needed.

You can reach me in the discord channel as user @spuder and we can chat more if you like.

@spuder
Copy link
Owner

spuder commented Dec 29, 2024

image

@spuder
Copy link
Owner

spuder commented Dec 29, 2024

image

@koffienl
Copy link

koffienl commented Jan 1, 2025

image

Any chance this would be available for download any time soon?

@spuder spuder added the enhancement New feature or request label Jan 6, 2025
@spuder spuder added the question Further information is requested label Jan 15, 2025
@mytechguyri
Copy link

Nice looking design.... had you considered positioning the readers the same way Bambu does. with them back to back, one between spools 1 & 2 and the 2nd between spools 3&4? Would make for a more compact install, and improved wire routing.

Also, versions compatible with Hydra and Python AMS mods would be fantastic (and would be probably easier to implement since the fill model for Python is available, with an active developer... if you coordinate with the Python designer (Hum), he could likely bake it right into his existing design making for a seemless integration.

@ManuelW77
Copy link

Since the p1/x1 support up to 17 spools, the preferred design will probably be to have 1x esp32 per AMS and use a CANBUS or wireless link between them, where one of them is the dedicated mqtt client since the P1 (and possibly the x1) have a limit of 4 mqtt clients.

You can use a simple mqtt proxy for that. the proxy connects to the printer and copys the channels read/write. So you can connect as many clients you want to the proxy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants