Ok, I enabled dev mode, and it helped me spot the error : it was treating
my 4 images as a single file. In weewx.conf, we should not put the 4 images
between ' ... '.
And now it works :))
Thanks for this great extension, and your help!
Sep 02 15:30:55 vegan python3[13958]: weewx[13958] DEBUG user.wxtoot:
number of images for upload 1
Sep 02 15:30:55 vegan python3[13958]: weewx[13958] INFO user.wxtoot: media
is /home/weewx/external_html/daytempdew.png,dayrain.png,dayuv.png
Sep 02 15:30:55 vegan python3[13958]: weewx[13958] INFO user.wxtoot: media
is not a file
/home/weewx/external_html/daytempdew.png,dayrain.png,dayuv.png and of type
<class 'str'>
Sep 02 15:30:55 vegan python3[13958]: weewx[13958] INFO user.wxtoot: our
media_list images are 0 : []
On Saturday, September 2, 2023 at 3:24:15 PM UTC+2 Invisible Man wrote:
> Ok ! I hadn't understood that at all.
> So, that's what I did, but my toot has no image. Though the logs mention 1
> upload of image... ?
>
>
> Sep 2 14:42:51 vegan weewx[12010] DEBUG weewx.engine: Loading service
> user.wxtoot.Toot
> Sep 2 14:42:52 vegan weewx[12010] INFO user.wxtoot: service version is
> 0.04
> Sep 2 14:42:52 vegan weewx[12010] INFO user.wxtoot: unit system is metric
> Sep 2 14:42:52 vegan weewx[12010] DEBUG user.wxtoot: site_dict is :
> {'station': 'biotmeteo', 'key_access_token': 'EDITED :))',
> 'server_url_mastodon': 'https://piaille.fr', 'post_interval': '14400',
> 'cardinal': 'true', 'image_directory': '/home/weewx/external_html',
> 'images': 'daytempdew.png,dayrain.png,dayuv.png', 'template_file':
> '/home/weewx/external_html/mastodon.txt', 'format_choice': 'template',
> 'dev_mode': False, 'log_success': True, 'log_failure': True, 'unit_system':
> 16, 'format_ordinal': True, 'format': 'Missing template file path',
> 'server_url_image': '', 'template_last_file': '', 'format_None': '-',
> 'format_utc': False, 'ordinals': ['N', 'NNE', 'NE', 'ENE', 'E', 'ESE',
> 'SE', 'SSE', 'S', 'SSW', 'SW', 'WSW', 'W', 'WNW', 'NW', 'NNW', 'N', '-'],
> 'visibility': 'unlisted'}
> Sep 2 14:42:52 vegan weewx[12010] INFO user.wxtoot: toot visibility is
> unlisted
> Sep 2 14:42:52 vegan weewx[12010] INFO user.wxtoot: binding is archive
> Sep 2 14:42:52 vegan weewx[12010] INFO user.wxtoot: Data will be tooted
> for biotmeteo
> Sep 2 14:42:52 vegan weewx[12010] DEBUG weewx.engine: Finished loading
> service user.wxtoot.Toot
> Sep 2 14:46:13 vegan weewx[12010] DEBUG user.wxtoot: number of images for
> upload 1
>
> The images are accessible. Example:
>
> $ ls -al /home/weewx/external_html/daytempdew.png
> -rw-r--r-- 1 weewx axelle 8161 Sep 2 15:20
> /home/weewx/external_html/daytempdew.png
>
> This is weewx.conf:
>
> [StdRESTful]
> [[Mastodon]]
> station = biotmeteo
> # from your account under preferences/development/application
> key_access_token = EDITED :)
> server_url_mastodon = https://piaille.fr
> # Mastodon will rate limit when excessive requests are made
> post_interval = 14400
> # convert from numeric degrees to Cardinal points - true or false
> cardinal = true
> # complete if fetching images via a webserver
> #server_url_image = ''
>
> # complete if uploading images from a local directory
> image_directory = '/home/weewx/external_html'
> # comma separated list of up to 4 images
> images = 'daytempdew.png,dayrain.png,dayuv.png'
> # example: /var/www/html/weewx/DATA/mastodon.txt
> template_file = '/home/weewx/external_html/mastodon.txt'
> #template_last_file = '/var/www/html/weewx/DATA/mastsummary.txt'
> # post formats - simple, full, template
> format_choice = template
> dev_mode = False
> On Friday, September 1, 2023 at 1:17:59 AM UTC+2 Glenn McKechnie wrote:
>
>> On 01/09/2023, Invisible Man <[email protected]> wrote:
>> > Glenn,
>> > How am I meant to publish images on Mastodon?
>> > I have this in weewx.conf for the Mastodon extension:
>> >
>> > ```
>> > # comma separated list of up to 4 images
>> > images =
>> >
>> '/home/weewx/external_html/daytempdew.png,/home/weewx/external_html/dayrain.png,/home/weewx/external_html/dayuv.png'
>>
>>
>> > ```
>> >
>> > Those paths lead to graphs. I thought they would be appended to the
>> toot,
>> > like in the image of the README.md
>> > of https://github.com/glennmckechnie/weewx-mastodon, but that's not
>> the
>> > case. So, how does it work?
>>
>> paths and images are declared separately.
>>
>> In the weewx.conf section, [[Mastodon]] , there are 3 lines relating to
>> images.
>> In your example, you want these 2.
>>
>> # complete if uploading images from a local directory
>> image_directory = /home/weewx/external_html
>> # comma separated list of up to 4 images
>> images = daytempdew.png, dayrain.png, dayuv.png
>>
>> That should work for you, and if it doesn't then review the log for
>> wxtoot specific messages and include them in a reply.
>>
>> > This is my mastodon account: https://piaille.fr/@biotmeteo
>> >
>> > Thanks,
>> > Axelle
>>
>> --
>>
>>
>> Cheers
>> Glenn
>>
>> rorpi - read only raspberry pi & various weewx addons
>> https://github.com/glennmckechnie
>>
>
--
You received this message because you are subscribed to the Google Groups
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/weewx-user/e884daf3-c68a-4a64-9892-678f2e0f099cn%40googlegroups.com.