Please login or register.

Login with username, password and session length
Pages: 1 [2] 3

Author Topic: raspberry pi 4 and email  (Read 6847 times)

bkenobi

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 24
  • Posts: 2081
Re: raspberry pi 4 and email
« Reply #15 on: January 31, 2021, 05:12:42 PM »

Exactly. If mike read the solution and the error log, he'd have had all the info he needed to correct the issue way back then.  Here's hoping another gentle push in that direction is useful.

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1750
Re: raspberry pi 4 and email
« Reply #16 on: January 31, 2021, 05:47:42 PM »

I’ve no idea what the Python solution was all about either. Do users here realize that HG uses Iron Python 2.7 and not Standard Python which is at v 3.8. The code between the two is not interchangeable. Why users are stepping outside of HG to come up with solutions is beyond me. HG supports C#, JavaScript and Iron Python all the tools you need to formulate a solution in HG.
Logged

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 1057
Re: raspberry pi 4 and email
« Reply #17 on: January 31, 2021, 07:15:37 PM »

You two are funny.  Perhaps if you had looked at what the issue is you would have seen this is not a case of HG not accepting proper email parameters.

To humor you one last time, I will repeat that I did all the tests, enters, etc., recommended, as well as actually replacing the email parameter section of the HG config file with known good values.  NONE had any bearing on this new issue on this new Pi4 system.  The symptoms are not even close to the ones we get when the email parameters are incorrect.

The Net.SendMessage command just no longer parses the arguments correctly in the pi4.  Nothing to do with the #142 email send program or its parameters.  Any program using it crashes on running it and will not go on to further commands in the program list (such as testing for true and sending "sent" or "not sent."
« Last Edit: January 31, 2021, 07:17:32 PM by mike »
Logged

bkenobi

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 24
  • Posts: 2081
Re: raspberry pi 4 and email
« Reply #18 on: January 31, 2021, 08:56:09 PM »

If you believe the issue is with the hardware, I would recommend taking your working sd card out of your zero and try it in the RPi4. The system should fire right up and send emails correctly. If not, then its something with the RPi4.

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1750
Re: raspberry pi 4 and email
« Reply #19 on: January 31, 2021, 09:17:13 PM »

You’re C# script compiles without error. True or false. If that statement is true your log has clearly indicated that the string you are using is formatted incorrectly. If you choose not to believe the logs and clearly you have completely dismissed the advice you have been given here you can report the error to the following

https://www.newtonsoft.com/json

https://github.com/raspberrypi

I’m not sure about @bkenobi but I’m done getting into discussions with someone who clearly refuses to listen to reason. Unless you’ve somehow magically fried your RPI4 you’ve been given a logical explanation to your issue and a subsequent solution, neither of which you want to listen to.

If you refer back to a previous post you made regarding which RPI to purchase to replace your Pi Zero you were clearly advised to opt for the RPI3b +. In your wisdom you opted for the RPI4. In hindsight was that a wise decision bearing in mind that your issue is linked to the RPI4 in your opinion. Clearly logic doesn’t enter into the equation here.
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 282
  • Posts: 10497
  • I don't work for X10, I use it successfuly!
Re: raspberry pi 4 and email
« Reply #20 on: February 01, 2021, 08:12:29 AM »

I’ve no idea what the Python solution was all about either. Do users here realize that HG uses Iron Python 2.7 and not Standard Python which is at v 3.8. The code between the two is not interchangeable. Why users are stepping outside of HG to come up with solutions is beyond me. HG supports C#, JavaScript and Iron Python all the tools you need to formulate a solution in HG.
The reason user step outside of HG for a solution is exactly that, the code, libraries aren't interchangeable. Some of the old libraries in HG are no longer stable or don't work with newer devices.
 My suggestion to using python out side HG was in responce to Mikes wondering about passing email tasks to another  email program. Python2 & 3 are included in a Buster full install which Mike is running.
 I use Python 3 outside HG for a few projects which HG can't  at the moment support like the Brodlink RM. As well I use Python3 for my DHT sesors which currently don't work with HG and the c+ code (DHT library) isn't  as stable. Since fixes to HG are slow coming.
 I'm all for stepping outside the confinds of HG if that solves the issue at hand.
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1750
Re: raspberry pi 4 and email
« Reply #21 on: February 01, 2021, 09:08:11 AM »

I’ve no idea what the Python solution was all about either. Do users here realize that HG uses Iron Python 2.7 and not Standard Python which is at v 3.8. The code between the two is not interchangeable. Why users are stepping outside of HG to come up with solutions is beyond me. HG supports C#, JavaScript and Iron Python all the tools you need to formulate a solution in HG.
The reason user step outside of HG for a solution is exactly that, the code, libraries aren't interchangeable. Some of the old libraries in HG are no longer stable or don't work with newer devices.
 My suggestion to using python out side HG was in responce to Mikes wondering about passing email tasks to another  email program. Python2 & 3 are included in a Buster full install which Mike is running.
 I use Python 3 outside HG for a few projects which HG can't  at the moment support like the Brodlink RM. As well I use Python3 for my DHT sesors which currently don't work with HG and the c+ code (DHT library) isn't  as stable. Since fixes to HG are slow coming.
 I'm all for stepping outside the confinds of HG if that solves the issue at hand.

But you have all the tools you need in HG to create scripts for the hardware you mentioned. I’ve no doubt that users like @bkenobi if needed would have code in place immediately to run the DHT sensors by adapting the code that’s already available in HG.

If you’re going to use standard Python code you are finding in various GitHubs, most of which won’t work directly in HG without modification you may as well use an application like Home Assistant which is heavily maintained and use MQTT to pass your readings to HG.

As I mentioned you need to adapt the scripts already available in HG. The only way to do this is to analyze the code for the DHT sensors and adapt it.
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 282
  • Posts: 10497
  • I don't work for X10, I use it successfuly!
Re: raspberry pi 4 and email
« Reply #22 on: February 01, 2021, 11:58:44 AM »

 HG can access external Python2 or 3 scripts running on the PI directly (start with paramiters and read out the put) . There is no need to switch to Home Assistant to use MQTT, HG has this! There also is no need for MQTT for the Python scripts I use, although I do have MQTT setup just not for that.

The C+ code for the DHT sensors is unstable, Python is better suited for sensors like these, this is not a HG thing, though current HG DHT code doesn't work at all.
I had thought of addapting the Python Addafruit DHT library to work in Iron python for HG but why reinvent the wheel.
The Python3 scripts I run will not be affected when/if HG is updated unlike some of my early HG addon program fixes.

I also I have no doubt that users like @bkenobi if needed would have code in place immediately to run things like the DHT sensors by adapting the code that’s already available in HG. Do what works for you!

The email failing to issue has been going on for far to long.  I've just noticed my Off grid HG setup is no longer sending emails (had it disabled while there) it may be as simple as changing the password configured (I Hope so).
Guess I should look at my city HG email settup as well ::) :'.
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1750
Re: raspberry pi 4 and email
« Reply #23 on: February 01, 2021, 01:01:33 PM »

HG can access external Python2 or 3 scripts running on the PI directly (start with paramiters and read out the put) . There is no need to switch to Home Assistant to use MQTT, HG has this! There also is no need for MQTT for the Python scripts I use, although I do have MQTT setup just not for that.

The C+ code for the DHT sensors is unstable, Python is better suited for sensors like these, this is not a HG thing, though current HG DHT code doesn't work at all.
I had thought of addapting the Python Addafruit DHT library to work in Iron python for HG but why reinvent the wheel.
The Python3 scripts I run will not be affected when/if HG is updated unlike some of my early HG addon program fixes.

I also I have no doubt that users like @bkenobi if needed would have code in place immediately to run things like the DHT sensors by adapting the code that’s already available in HG. Do what works for you!

The email failing to issue has been going on for far to long.  I've just noticed my Off grid HG setup is no longer sending emails (had it disabled while there) it may be as simple as changing the password configured (I Hope so).
Guess I should look at my city HG email settup as well ::) :'.

I'm quite familiar with how HG handles Python or Iron Python in this case. I've a number of sensors already reporting to it using the integrated solution provided by HG via the Nuget package manager. In fact I'm using the Arduino with sensors connected to the RPI via the Serial Port. A far more efficient solution.

I suggested using Home Assistant if all you're doing is grabbing Python 3 library code from the Githubs. Pointless when you can do all of this natively in HG. I'm not familiar with the C+ code being unstable for DHT sensors. Do you have the source where you saw this. I'm familiar with the Adafruit DHT library too.

What was causing issues with the native DHT support in HG was HG's inability to load the correct BCM driver. That issue has now been resolved by @bkenobi so I don't see where you are having problems. Have you tried troubleshooting your issue on the HomeGenie Club forum. There are a number of other users I know of that are using the DHT sensors natively that I am sure could assist you. Don't be afraid to ask for help.

By using the maxim "do whatever works for you" it wont help HG progress any further. Most of the native HG solutions could of course be executed externally. If that was the case why bother with HG at all. In fact the X10 facet of HG could be extracted and geared as a standalone solution. As I said instead of chipping away at workarounds post your issue along with your troubleshooting results in the HomeGenie Club forum for others to see and hopefully provide you with a solution.

I've completely washed my hands of any further discussion on the email issue. Myself and Bkenobi collaborated on this subject and have used solid metrics to come to our conclusion. We have shared these findings for others to see. Remember myself and Bkenobi do not have issues with email notification. Need I say any more on the subject.
Logged

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 1057
Re: raspberry pi 4 and email
« Reply #24 on: February 01, 2021, 01:48:36 PM »

The email failing to issue has been going on for far to long.  I've just noticed my Off grid HG setup is no longer sending emails (had it disabled while there) it may be as simple as changing the password configured (I Hope so).
Guess I should look at my city HG email settup as well ::) :'.

Just a thought:  be sure to apt update & full-upgrade before you work on the settings:  I just got my email to work on my pi4 by simply doing this - although my buster install is only a couple weeks old, the full-upgrade added over 1GB of changes!  Now, magically, my email works again.

PS:  bkenobi, your idea of trying the old zw was a good thought I had not thought of.  I knew I could not simply put the zw SD card in the pi4 and have it work - it never did - too many differences for that - no zw SD card will boot in any of my pi4 units, but it did prompt  me to verify that the zw as a stand along indeed still had working email. 
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 282
  • Posts: 10497
  • I don't work for X10, I use it successfuly!
Re: raspberry pi 4 and email
« Reply #25 on: February 01, 2021, 02:32:56 PM »

Thanks Mike nice to see you have your emailing sworking again.
I checked my city Email settings and there are none. ::) :' :-[ I know I had originaly set this up so not sure how they got lost.

@petera, I don't have the links to where there was mention of C+ DHT code being unstable but did read it in several locations on the web when I was attempting to get the HG DHT code working even with bkenobi's fix for the gpio pins which by the way does work just not for the DHT sensors I tested, and I did share this on homegenie.club.
However since no one apeared to still be using these sensors and the only advice I got was to use other sensors, I found my own solution.
I'll not revisit the issues with HG DHT program found in the Package Manager untill a possible new version of HG emerges. >!

Logged
Please Read Topic:
General Forum Etiquette
Before you post!

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1750
Re: raspberry pi 4 and email
« Reply #26 on: February 01, 2021, 02:46:18 PM »

I don't see what difference a new version of HG will make here. We've had 19 versions and nothing has changed in relation to the DHT sensor support with the exception of the work done on the BCM driver. That was the only driver that was causing difficulties and that's resolved now. What are you actually waiting for in a new HG release.
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 282
  • Posts: 10497
  • I don't work for X10, I use it successfuly!
Re: raspberry pi 4 and email
« Reply #27 on: February 01, 2021, 03:40:26 PM »

I don't see what difference a new version of HG will make here. We've had 19 versions and nothing has changed in relation to the DHT sensor support with the exception of the work done on the BCM driver. That was the only driver that was causing difficulties and that's resolved now. What are you actually waiting for in a new HG release.
Exactly 19 versions and nothing has changed in relation to the DHT.
I'll wait to see if the fix bkenobi submited gets implemented or if it needs to manualy be added again.
 Prior to the fix bkenobi created the DHT programs wouldn't even load for me now they do but fail to report data.
So your saying you used a DHT sensor with one of the HG DHT programs and it worked for you? ???
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1750
Re: raspberry pi 4 and email
« Reply #28 on: February 01, 2021, 03:57:54 PM »

I don't see what difference a new version of HG will make here. We've had 19 versions and nothing has changed in relation to the DHT sensor support with the exception of the work done on the BCM driver. That was the only driver that was causing difficulties and that's resolved now. What are you actually waiting for in a new HG release.
Exactly 19 versions and nothing has changed in relation to the DHT.
I'll wait to see if the fix bkenobi submited gets implemented or if it needs to manualy be added again.
 Prior to the fix bkenobi created the DHT programs wouldn't even load for me now they do but fail to report data.
So your saying you used a DHT sensor with one of the HG DHT programs and it worked for you? ???

No I didn't say that. I can see from the code that there's nothing to stop it working now. It's worked on Eden boards, Bananna Pi and of course the RPI in the past but clearly stopped working on the RPI for the reasons you know now.

If you don't think you can get it working now you could of course use the Python 3 code you are using now and refactor it to work in 2.7. Shouldn't be a major issue to do.
Logged

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1750
Re: raspberry pi 4 and email
« Reply #29 on: February 01, 2021, 04:25:57 PM »

If you haven't already got a copy, I suggest getting a copy of Visual Studio and download this. It's a proper debugger for Iron Python that you run code through and identify errors quickly. https://ironpython.net/tools/ You can of course use 3to2 to help you refactor Python 3 code to work in Python 2  https://wiki.python.org/moin/3to2
Logged
Pages: 1 [2] 3
 

X10.com | About X10 | X10 Security Systems | Cameras| Package Deals
© Copyright 2014-2016 X10.com All rights reserved.