Project piTelex - News Service (Nachrichtendienst)

Technischer Support bei Problemen mit piTelex
Antworten
Benutzeravatar

Topic author
JoeyD
Rank 2
Rank 2
Beiträge: 61
Registriert: Do 31. Mär 2022, 08:23
Wohnort: Jackson, Michigan
Hauptanschluß: 362436 joeyd
Kontaktdaten:

Project piTelex - News Service (Nachrichtendienst)

#1

Beitrag: # 33373Beitrag JoeyD »

I have the news service enabled,
This was a bit of a challenge.

My question:
How do I change the frequency of checking the news feed? To check either more often or less often.

I do not see anything for frequency in telex.json and not sure which module I would need to change??

Also.....
I would also like to change the ending of the stored NEWS telex messages from ++++ to NNNN (USTTY Standard)
And also eliminate the additional "Line Feeds". When it stores the message it adds 2 extra line feeds before and
after the message this uses a lot of paper. <-Help save a tree! LOL!
Try to stay mellow like the Dachshund! :hehe:

362436: Teletype Model 26 Blatt 24/7
8675309: Western Union 2B Streifen 24/7
2210762: Soviet ST-35 Streifen 24/7
227895: Western Union 28ASR Blatt 24/7
227896: I-Telex Serial + WinTelex24/7
Benutzeravatar

obrecht
Rank 6
Rank 6
Beiträge: 505
Registriert: Fr 26. Jun 2020, 18:53
Wohnort: Aachen
Hauptanschluß: 833539 fili d

Re: Project piTelex - News Service (Nachrichtendienst)

#2

Beitrag: # 33386Beitrag obrecht »

JoeyD hat geschrieben: So 11. Sep 2022, 20:22 How do I change the frequency of checking the news feed? To check either more often or less often.
https://github.com/fablab-wue/piTelex/w ... FileWriter
says there is a command line parameter for rssFileWriter.py: -t or --timeout : timeout(seconds) between fetching feed updates, default 10 seconds
JoeyD hat geschrieben: So 11. Sep 2022, 20:22
Also.....
I would also like to change the ending of the stored NEWS telex messages from ++++ to NNNN (USTTY Standard)
And also eliminate the additional "Line Feeds". When it stores the message it adds 2 extra line feeds before and
after the message this uses a lot of paper. <-Help save a tree! LOL!
Edit rssFileWriter.py. Look for the following routine "formatted_write". Here you can modify the look&feel of the output. I've marked some of the relevant lines with an arrow below:

Code: Alles auswählen

def formatted_write(output_path, rss_entry, visible_name, split_lines):
    with open(outfilename, "a+") as outfile:
        summary = h.handle(rss_entry.summary)
        summary = summary.replace('\n', ' ')
        heading = visible_name + "  " + time.strftime("%d.%m.%Y %H:%M:%S", time.localtime(calendar.timegm(rss_entry.published_parsed)))
-->        outfile.write(heading + "\n\n")
        heading = rss_entry.title
        heading = split_newline_after("== " + heading + " ==", split_lines)
        #summary = "     " + summary
        summary = split_newline_after(summary, split_lines)
-->        outfile.write(heading + "\n")
-->        outfile.write(summary + "\n++++\n")
        print(heading)
        print(summary)
Good luck!
Viele Grüße,
Rolf

833538 obrac d  24/7  (FS220)
833539 fili d   24/7  (T100a)
833540 rowo d   24/7  (T100/R) 
71920 actelex d 24/7  (T68d)
833541 obby d   24/7  (T37h)
833142 rolf d   24/7  (Lo15A) (pi-telex ist endlich fertig!)
Benutzeravatar

Topic author
JoeyD
Rank 2
Rank 2
Beiträge: 61
Registriert: Do 31. Mär 2022, 08:23
Wohnort: Jackson, Michigan
Hauptanschluß: 362436 joeyd
Kontaktdaten:

Re: Project piTelex - News Service (Nachrichtendienst)

#3

Beitrag: # 33387Beitrag JoeyD »

Obrac,
Thanks for the reply!

The second part of your reply on new lines is EXACTLY what I needed!
I see all the offending extra new lines that I want to eliminate.

On to the first part.... I probably was not clear.......
I know I can change the time if I call the newsfeed from the command line using ./rssFileWriter.py -t "XX"
I want to change the time calling multiple copies using "./rss-feed" script
A time change this was not offered only "list, status, start, stop, and help"
I think I found the line to change......

python3 $RSSROOT/rssFileWriter.py -f -s "$LINELENGTH" -n "$SVC" -p "$NEWS/$SVC/" -u "$URL" &> "$LOG/$SVC.log"

I think I just need to add the desired -t time out like this???....

python3 $RSSROOT/rssFileWriter.py -f -t 3600 -s "$LINELENGTH" -n "$SVC" -p "$NEWS/$SVC/" -u "$URL" &> "$LOG/$SVC.log"

The rss-feed file script indicates "### no user serviceable parts below ###"
So not sure what sort of mess I invite changing this line? My timing is for 1 hour checks and not sure if it will accept this?
And if it does it is a very long wait to find out! ;-)
Also I find it easier to ask about code I'm not familiar with incase this may break something somewhere else...

Thanks again/Danke!!
JD
Folgende Benutzer bedankten sich beim Autor JoeyD für den Beitrag:
obrecht
Try to stay mellow like the Dachshund! :hehe:

362436: Teletype Model 26 Blatt 24/7
8675309: Western Union 2B Streifen 24/7
2210762: Soviet ST-35 Streifen 24/7
227895: Western Union 28ASR Blatt 24/7
227896: I-Telex Serial + WinTelex24/7
Benutzeravatar

obrecht
Rank 6
Rank 6
Beiträge: 505
Registriert: Fr 26. Jun 2020, 18:53
Wohnort: Aachen
Hauptanschluß: 833539 fili d

Re: Project piTelex - News Service (Nachrichtendienst)

#4

Beitrag: # 33391Beitrag obrecht »

JoeyD hat geschrieben: Mo 12. Sep 2022, 14:31 I think I just need to add the desired -t time out like this???....

python3 $RSSROOT/rssFileWriter.py -f -t 3600 -s "$LINELENGTH" -n "$SVC" -p "$NEWS/$SVC/" -u "$URL" &> "$LOG/$SVC.log"
Exactly.🤗
JoeyD hat geschrieben: Mo 12. Sep 2022, 14:31 The rss-feed file script indicates "### no user serviceable parts below ###"
So not sure what sort of mess I invite changing this line?
There should be no side effects. If you encounter one, let me know 😉

I did not use such a long interval up to now, therefore I cannot say wether this might be a problem or not, but I think it should be okay.

Hear from. you after a couple of hours 😁
Folgende Benutzer bedankten sich beim Autor obrecht für den Beitrag:
JoeyD
Viele Grüße,
Rolf

833538 obrac d  24/7  (FS220)
833539 fili d   24/7  (T100a)
833540 rowo d   24/7  (T100/R) 
71920 actelex d 24/7  (T68d)
833541 obby d   24/7  (T37h)
833142 rolf d   24/7  (Lo15A) (pi-telex ist endlich fertig!)
Benutzeravatar

Topic author
JoeyD
Rank 2
Rank 2
Beiträge: 61
Registriert: Do 31. Mär 2022, 08:23
Wohnort: Jackson, Michigan
Hauptanschluß: 362436 joeyd
Kontaktdaten:

Re: Project piTelex - News Service (Nachrichtendienst)

#5

Beitrag: # 33393Beitrag JoeyD »

Obrecht,
Ideally I would like to make the configuration file different for each news service.
Some to check on the hour
Some to check on the .1 hour. or whatever I choose like a day

Something like....
Detroit_News 3600 https://rssfeeds.detroitnews.com/detroit/news&m=1
BBC_News 360 http://feeds.bbci.co.uk/news/rss.xml
Welt_News 86400 https://www.welt.de/feeds/latest.rss

But I need to study how the CFG and rss-feed passes the two variables down and change to 3 variables??

I do not need them to check every 10 seconds. But I would like different intervals for different services
I have some I would only like to check once a day (86400) seconds...
I do not know what the timers maximum limit is????
Try to stay mellow like the Dachshund! :hehe:

362436: Teletype Model 26 Blatt 24/7
8675309: Western Union 2B Streifen 24/7
2210762: Soviet ST-35 Streifen 24/7
227895: Western Union 28ASR Blatt 24/7
227896: I-Telex Serial + WinTelex24/7
Benutzeravatar

obrecht
Rank 6
Rank 6
Beiträge: 505
Registriert: Fr 26. Jun 2020, 18:53
Wohnort: Aachen
Hauptanschluß: 833539 fili d

Re: Project piTelex - News Service (Nachrichtendienst)

#6

Beitrag: # 33406Beitrag obrecht »

JoeyD hat geschrieben: Mo 12. Sep 2022, 18:03 Obrecht,
Ideally I would like to make the configuration file different for each news service.
I do not know what the timers maximum limit is????
Joey,
I managed to adapt rss-feed script to your needs (hopefully). Please try the script from branach 'exp-r01f'.
You should be able to specify the timeout as third parameter in each line of the cfg file; if omitted, it defaults to 10 seconds.

The given timeout just calls the python routine time.sleep() which should be the only limitation concerning the duration.

I would be glad to hear from you about your experience with this version!
Folgende Benutzer bedankten sich beim Autor obrecht für den Beitrag:
JoeyD
Viele Grüße,
Rolf

833538 obrac d  24/7  (FS220)
833539 fili d   24/7  (T100a)
833540 rowo d   24/7  (T100/R) 
71920 actelex d 24/7  (T68d)
833541 obby d   24/7  (T37h)
833142 rolf d   24/7  (Lo15A) (pi-telex ist endlich fertig!)
Benutzeravatar

Topic author
JoeyD
Rank 2
Rank 2
Beiträge: 61
Registriert: Do 31. Mär 2022, 08:23
Wohnort: Jackson, Michigan
Hauptanschluß: 362436 joeyd
Kontaktdaten:

Re: Project piTelex - News Service (Nachrichtendienst)

#7

Beitrag: # 33477Beitrag JoeyD »

Obrecht,
I'd like to report that your CFG and rss-feed changes work perfectly!!
And my changes to remove the extra "/n" new lines in rssFileWriter.py also work great.
This took some time to test as I had most of the feeds checking every hour 3600seconds vs every 10 seconds.
When it is checking 10 feeds every 10 seconds it chews up bandwidth and processor time for actual telex connections.
==========================
Which brings up one small problem.... When the news is sent to be printed "by the telex" the time out to shut off the motor is
extremely long. It will print the stories then the motor will stay on for a few minutes and eventually shut off. During the time it
is idle from printing and motor running it will not accept a telex call..
Not sure where that setting is.
==========================
Anyway...
Thanks again for the help!!

Now we need to figure out how to get my twitter to work!!! ;-)
JD
Folgende Benutzer bedankten sich beim Autor JoeyD für den Beitrag:
obrecht
Try to stay mellow like the Dachshund! :hehe:

362436: Teletype Model 26 Blatt 24/7
8675309: Western Union 2B Streifen 24/7
2210762: Soviet ST-35 Streifen 24/7
227895: Western Union 28ASR Blatt 24/7
227896: I-Telex Serial + WinTelex24/7
Benutzeravatar

obrecht
Rank 6
Rank 6
Beiträge: 505
Registriert: Fr 26. Jun 2020, 18:53
Wohnort: Aachen
Hauptanschluß: 833539 fili d

Re: Project piTelex - News Service (Nachrichtendienst)

#8

Beitrag: # 33488Beitrag obrecht »

JoeyD hat geschrieben: Do 15. Sep 2022, 06:37 Which brings up one small problem.... When the news is sent to be printed "by the telex" the time out to shut off the motor is
extremely long. It will print the stories then the motor will stay on for a few minutes and eventually shut off. During the time it
is idle from printing and motor running it will not accept a telex call..
Not sure where that setting is.
This is controlled by some watchdog timeouts, and I don't know how to change this without interfering with other dependencies. But there's no reason to let the printer wait for nothing when the message has been completely printed. So the following hack works for me, and will possibly also do for you (no warranty for anything...): :suspect:

Edit txDevNews.py, look for the following lines of code at the bottom of the file:

Code: Alles auswählen

    def idle20Hz(self):
(... some more lines....)
                for a in aa:
                    self._rx_buffer.append(a)
and append the line

Code: Alles auswählen

                self._rx_buffer.append('\x1bST')
so that the result is

Code: Alles auswählen

    def idle20Hz(self):
(... some more lines....)
                for a in aa:
                    self._rx_buffer.append(a)
                self._rx_buffer.append('\x1bST')
Be careful to use the correct indentation, it is important in python, as you know.
Adding the "ST" command tells piTelex that the "ST" button has been pressed on the FSG, so that it goes back into standby :grin:
JoeyD hat geschrieben: Do 15. Sep 2022, 06:37 Now we need to figure out how to get my twitter to work!!! ;-)
Errr...not my job.... but Jochen (JKde) can certainly help. BTW: Did you try the new Twitter version twitterv2? The developer seems to be very active and will answer your questions, I think. Up to now, it is only part of the master branch (only Jochen knows why...)

Good look, and nice to hear from you in the future, maybe as a telex msg?
Folgende Benutzer bedankten sich beim Autor obrecht für den Beitrag:
JoeyD
Viele Grüße,
Rolf

833538 obrac d  24/7  (FS220)
833539 fili d   24/7  (T100a)
833540 rowo d   24/7  (T100/R) 
71920 actelex d 24/7  (T68d)
833541 obby d   24/7  (T37h)
833142 rolf d   24/7  (Lo15A) (pi-telex ist endlich fertig!)
Benutzeravatar

Topic author
JoeyD
Rank 2
Rank 2
Beiträge: 61
Registriert: Do 31. Mär 2022, 08:23
Wohnort: Jackson, Michigan
Hauptanschluß: 362436 joeyd
Kontaktdaten:

Re: Project piTelex - News Service (Nachrichtendienst)

#9

Beitrag: # 33489Beitrag JoeyD »

Obrecht,
I am at work now so I will try the txDevNews.py modification when I get home.
I assume I will need to exit telex.py and restart it.
I don't want to try it remotely in case something messes up and I can't shut the machine off
or it decides to run out of paper!! LOL!!

When I am at home working in the room where all my teletype machines are at
If I happen to hear the motor running, I SSH to the machine and send (ESC)ST effectively ending the idle motor.
So I feel pretty good your work around should fix it!!. Its exactly what I'm doing SSH'ing to it.
Curious this has not annoyed anyone else!, That its not
a commit to the main code??

Thanks again
JD
Try to stay mellow like the Dachshund! :hehe:

362436: Teletype Model 26 Blatt 24/7
8675309: Western Union 2B Streifen 24/7
2210762: Soviet ST-35 Streifen 24/7
227895: Western Union 28ASR Blatt 24/7
227896: I-Telex Serial + WinTelex24/7
Antworten

Zurück zu „Technischer Support (piTelex)“