electric-sheep-co / arduino-redis

A Redis client library for Arduino.
http://arduino-redis.com
MIT License
54 stars 19 forks source link

Ethernet support with redis library. #23

Open rahulsharma11 opened 5 years ago

rahulsharma11 commented 5 years ago

HI, Thanks for the great redis library for Arduino. I am using Ethernet shield with arduino. I tried to replace wifi connectivity with EthernetClient library but no success. Any ideas? Thanks.

rpj commented 5 years ago

Hi @rahulsharma11: you're very welcome, and thank you for using the library and even more so, taking the time to file an issue! It is much appreciated.

To be honest, adding Ethernet support has been on my personal "TODO" list for awhile: I even ordered an Ethernet shield specifically for it! So that's part of the good news: I have all the hardware I need to work on Ethernet support.

In the very near term: it's nearly midnight where I am so I don't have the time tonight to tackle it. However, now that I'm aware it's an issue for you, I'll put it right at the top of the official "TODO" list as well and can assure you I'll look into it as soon as I'm able.

In short: please stay tuned, I'll have support for it available very soon!

rahulsharma11 commented 5 years ago

Oh, that's great. Thanks for your kind and quick reply. Eagerly waiting for the update. Thanks.

rpj commented 5 years ago

Also @rahulsharma11, what hardware are you using with your Ethernet shield? Any details you don't mind sharing about your setup, software, etc. can't hurt. If you feel comfortable sharing code snippets that are causing you trouble, I might be able to help debug and also they'll be mighty helpful to verify the support as I bring it up. Thanks a ton!

rahulsharma11 commented 5 years ago

Hi, I am using arduino nano+ HanRun HR911105A Arduino Ethernet shield. Code i have tested- Arduino Ethernet TCP-client chat example with server code(C-code) running on my linux laptop. Also tested redis with respberry pi and my laptop but searching for arduino based redis client example. Just watched your github project and did some changes for etherent support but no luck. Anything more you need from my side? Will happy to share with you

rpj commented 5 years ago

@rahulsharma11 That's exactly the information I needed, thanks a million! I'll get right on this tomorrow: I hope to be able to get something made available within a week or less. I'll be sure to notify you via this issue when the new version with Ethernet support is available. Thanks again!

rahulsharma11 commented 5 years ago

Hi, @rpj , Any success ?

rpj commented 5 years ago

Hey @rahulsharma11, so sorry for my long-delayed response here: I fell quite ill last week and am only now starting to slowly recover and "feel human" again.

Part of the reason I hadn't updated here in awhile is that my initial investigation - using an Uno plus a generic Ethernet shield with the same chip-set as yours - revealed, admittedly, a bit of a gap in my understanding of Arduino in general.

Basically, it turns out that the way I've implemented this library - mainly, using STL types for many things, most specifically my use of std::shared_ptr - serve to make it not as portable as I was initially expecting it to be.

More specifically: not all Arduino devices are equal, of course, and the very limited resources of platforms like the Nano and Uno make it impossible for those platforms to include the STL as part of the C++ feature set.

TL;DR: the way I've written this library makes it - as it stands now - only suitable for more-capable Arudino platforms such as the ESP family of devices.

I have investigated a couple potential solutions, but unfortunately none of them are "quick fixes". In short, it would either involve making use of paired-down STL implementations for the AVR platforms and others, or rewriting the library without and STL reliance. The correct approach is the latter (debateably), and so I may try to head down that path soon.

I will of course keep this issue open indefinitely as I do eventually plan to make this library support as many devices as possible, but unfortunately in the short term I don't believe it will fit your needs. My apologies again, and thank you so much for sticking around this far, I hope you continue to do so as I make further progress!

rahulsharma11 commented 5 years ago

Hi, No issue. I appreciate your concern. Will also try to figure it out with arduino uno. Thanks for the support.

rpj commented 5 years ago

I'll keep this one open as I definitely want to add Ethernet support eventually and this is a perfect issue to use to track that. Additionally, I expect this isn't the last time this support is requested, so at least this gives other folks a place to voice that request. Feel free to leave a :+1: on this comment if you're also looking for Ethernet support: it'll help me prioritize this issue if anything. Thanks @rahulsharma11!

Domigome commented 3 years ago

Hi,

Any updates on this? I wanted to ask about the same (which is still described on the documentation).

For what I see on this issue, it has been tried, but seems complicated or tricky to implement.

I'm using Arduino Mega, which I am not sure if could handle the STL well.

If by any chance this could happen someday it would be really cool, I am not quite yet in the knowledge of Arduino but if we need to make a branch to try this out I would be glad to give it a few tries and report back :)

rpj commented 3 years ago

if we need to make a branch to try this out I would be glad to give it a few tries and report back :)

Hi @Domigome, I would love to hear your results if you do end up making a branch, and am always happen to accept pull requests as well! Unfortunately I simply do not have the hardware on hand to develop & test this myself, so it will have to be a community effort. Thanks!