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

Need to support other WiFi platforms like the Nano 33 IOT, Maker Wifi ,etc #29

Closed
dduehren opened this issue Apr 16, 2020 · 33 comments
Closed

Comments

@dduehren
Copy link

I am trying to use this library on a Nano 33 IOT device which has built-in Wifi support and I have successfully run the example programs. It would be cleanest to use your NtpClock but it appears I have to develop my own because the current implementation requires an ESP8266, and I don't want to mess with the standard libraries to fix it. In general I am building a sophisticated system that has many users of the wifi, and it's best to just make yours assume that wifi is somehow provided and not only by an 8266.

@bxparks
Copy link
Owner

bxparks commented Apr 16, 2020

The restriction to ESP8266 and ESP32 is not intentional. They are just the only wifi enabled chips that I have. If you have suggestions on how to support other boards, I'd be happy to review them.

@dduehren
Copy link
Author

dduehren commented Apr 16, 2020 via email

@bxparks
Copy link
Owner

bxparks commented Apr 16, 2020

I'm not sure what you want me to do. I don't have that board, I can't test my code against it, so my code doesn't support it.

@dduehren
Copy link
Author

dduehren commented Apr 16, 2020 via email

@dduehren
Copy link
Author

dduehren commented Apr 16, 2020 via email

@bxparks
Copy link
Owner

bxparks commented Apr 16, 2020

Let me know when you verify that it works. As a rule, I don't include code that has not been tested to work.

Also, can you submit a proper pull request on GitHub so that I see the diff and use the normal code review process? It will also allow the code history to have proper attribution. If you don't know how to do that, I can do the diff and merge manually, but it's more work so I'll get around to it eventually..

@dduehren
Copy link
Author

dduehren commented Apr 16, 2020 via email

@dduehren
Copy link
Author

dduehren commented Apr 19, 2020 via email

@bxparks
Copy link
Owner

bxparks commented Apr 19, 2020

I looked up the specs for the Nano 33 IoT. It uses a SAMD21 Cortex-M0+ talking to an embedded ESP32 handle the WiFi and bluetooth. Just wondering, why not use a ESP32 board directly? It'll be cheaper, with one fewer component to go wrong and debug. If something doesn't work, you'll never be sure that they implemented the communication between the two chips correctly.

In any case, send me the minimal amount of changes needed to support your use case. The less the code, the easier it'll be to review it.

@dduehren
Copy link
Author

dduehren commented Apr 19, 2020 via email

@dduehren
Copy link
Author

dduehren commented Apr 24, 2020 via email

@bxparks
Copy link
Owner

bxparks commented Apr 24, 2020

You mean the various printTo() methods? Not right now. Just to double-check, your display library does not provide a class that implements Print? Because if it does, that's what you want to use.

Otherwise, the closest thing that I can recommend is to create something like my FakePrint class. Basically, you "print" to an in-memory buffer, then you get the result using the FakePrint.getBuffer() method.

I might be able to implement something useful this weekend. It seems like something that other people could use. The reason that I am reluctant to use a String is because it performs dynamic allocation of memory, which is terrible on a chip with only 2kB of RAM. I really want to make sure that AceTime performs no dynamic memory allocation.

@dduehren
Copy link
Author

dduehren commented Apr 24, 2020 via email

@dduehren
Copy link
Author

dduehren commented Apr 24, 2020 via email

@bxparks
Copy link
Owner

bxparks commented Apr 24, 2020

The Oled object pretends to be a Serial port. More precisely, both the Oled object and the Serial object are subclasses of the Print class. Your display library, if designed for the Arduino world, should provide a similar object.

Printing to a fixed buffer is not as easy as it sounds. The process of printing a date/time/timezone involves passing the buffer around to multiple objects, which then requires keeping a running count of how many characters were printed, so that things don't go off the cliff at the end of the buffer, causing the so called "buffer overrun". That's what the FakePrint encapsulates.

@dduehren
Copy link
Author

dduehren commented Apr 25, 2020 via email

@bxparks
Copy link
Owner

bxparks commented Apr 26, 2020

I can assume anything I want because it's my library, that I created for me, not for you or anyone else. If it works for you, that's great. If it does not, you can propose solutions, but you are not currently winning any favors by whining on the sidelines.

@dduehren
Copy link
Author

dduehren commented Apr 26, 2020 via email

@dduehren
Copy link
Author

dduehren commented Apr 26, 2020 via email

@bxparks
Copy link
Owner

bxparks commented Apr 26, 2020

I added a ace_time::common::CstrPrint class that might help with this. See the following for some sample code:

@dduehren
Copy link
Author

dduehren commented Apr 27, 2020 via email

@dduehren
Copy link
Author

dduehren commented Apr 27, 2020 via email

@dduehren
Copy link
Author

dduehren commented Apr 27, 2020 via email

@dduehren
Copy link
Author

dduehren commented Apr 27, 2020 via email

@dduehren
Copy link
Author

dduehren commented Apr 27, 2020 via email

@bxparks
Copy link
Owner

bxparks commented Apr 30, 2020

I'm glad that the code is working for you.

But I am unable to undersetand from your recent emails what changes you want to make to the AceTime code. You seem to assume that you uploaded something, but I don't see it. You seem to assume that I am familar with various 3rd party packages that you are using, like GUIslice, but I am not.

If you would like to make some changes to AceTime, send me a GitHub Pull Request.

@dduehren
Copy link
Author

dduehren commented May 1, 2020 via email

@dduehren
Copy link
Author

dduehren commented May 2, 2020 via email

@bxparks
Copy link
Owner

bxparks commented May 16, 2020

There is no ZIP file because you are not sending them to me directly. You are sending them to GitHub, which probably strips attachments out for security purposes.

I asked a couple of times that you should send me a Pull Request, or a diff of the minimal changes you would like to make to the AceTime library. Instead, you seem to be trying to send me your entire program. What do you want me to do with it? Figure out what changes you made to my project? This is not a worthwhile use of my time and effort.

So I'm going to close this ticket, because I cannot figure out what you want me to do. I'm glad you were able to use my library. Consider it my free gift to you.

@bxparks bxparks closed this as completed May 16, 2020
@dduehren
Copy link
Author

dduehren commented May 17, 2020 via email

@bxparks
Copy link
Owner

bxparks commented May 17, 2020

The best way to show someone else your code is to create a GitHub project, upload your code to it, then send them a link to your project.

The usual way to send changes to someone else's project is to "fork" the project in GitHub, make your changes on your computer, upload the changes to your own fork, then send a Pull Request (PR) from your fork to the original project. See help page could be useful: https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork . There are many many other resources available on the web.

If you are new to 'git' or GitHub, you have a lot of adventure ahead of you to learn those tools. You can get some amount of practice by using git, and sending Pull Requests to yourself for your own projects, before you start sending other people those things.

For very small changes, you can sometimes get away with sending a 'diff' file. This is created by a command called 'diff' (assuming you are using Linux or MacOS). If you are on Windows, sorry can't help you. You might be able to use CygWin on Windows, but if you know about CygWin, then you don't need me to explain this stuff to you.

I hope that gives you some pointers in the right direction.

@dduehren
Copy link
Author

dduehren commented May 17, 2020 via email

@bxparks
Copy link
Owner

bxparks commented May 17, 2020

I have to ask you go somewhere else to learn the basics about git and GitHub. I'm not your private tutor, and this is not the place for asking such things. Good luck on your projects though.

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

No branches or pull requests

2 participants