The values_list and tight coupling to the database

I've been evaluating this project as a way to obfuscate my internal identifiers. I think the work here is really good, so thank you so much for this tool and your work on this. As I've been evaluating this in my own project, I noticed that low level functionality like values_list doesn't actually provide the values but instead provides the Hashid object. For example:
In [1]: books = Book.objects.all()[:10]

In [2]: books.values_list('id', flat=True)
Out[2]: <QuerySet [Hashid(3): MzRKGR7, Hashid(6): WYjEbNm, Hashid(9): LVjZvj2, Hashid(12): P1a9rRX, Hashid(14): 0GRXVNL, Hashid(17): 1rNOMRY, Hashid(19): m6a6kRD, Hashid(21): JLN7QRv, Hashid(23): JoNYnaV, Hashid(25): KVNWLaP]>

Is there any way that you know of, to have this just flatly produce either the hash IDs or the IDs? Of course this could be built into a custom manager I'm sure, but it seems like this does modify the way the database ORM typically works in Django.
This makes me think that the tight binding to the database perhaps is too tight an abstraction. If what I'm trying to do is obfuscate database identifiers so that people can't just march up my IDs or see how active my platform is, is there a way to just use Hashids as some sort of middleware to just translate between id and hashid without being tightly coupled to the database?
DRF Serializer Extensions takes this approach, but I thought that the execution of the idea was far too confusing and required a lot of additional buy in towards using their other structures, which I wasn't interested in.
I really love the simplicity of what you have created here and the ease in which it can be implemented without messing with my database IDs. I was just wondering what other limitations beyond values_list may I encounter having this tied so closely to the database as a field.
Have you considered this as an extension where you can just implement this at the serializer level without touching models or migrations (with full understand that it's an abstraction)? Thanks again.

The tight coupling to the database is the entire point of this module, tbh. It's a model field for that reason. If you don't want that, you can take hashids strings from the user (i.e. "MzRKGR7") and convert that to an integer with just the Hashids library from pypi (which this module uses behind the scenes.) So something like:
hashids = Hashids(salt="something")
id = hashids.decode("MzRKGR7")
Book.objects.get(id=id)

Or to convert a bunch of integer IDs to hashids as in your example, you can do it manually like:
hashids = Hashids(salt="something")
books = Book.objects.all()[:10]
[hashids.encode(id) for id in books.values_list('id', flat=True)]

This module just abstracts that away for you, and allows you to set global configuration (salt, alphabet, minimum length) or field-by-field, do lookups by integer or hashid string, reference the value by either its original integer or encoded hashids string, works with django admin by default, drop in replace an existing field with existing data, etc.
It does break with the Django convention of not using descriptors to obfuscate values of model instances... I didn't really learn about that maxim until after I released this module. For me, I found it useful to be able to reference the two states of a given field at the same time... by integer or hashids string, hence why I used the descriptor to begin with. I'm not sure I would change it though, as having the field do the right thing depending on the context is handy. You can concatenate it to a string or use it in a template or str(book.id), and it'll be the hashids string. Or if you want the integer, you can just int(book.id). You can also access the raw types of any Hashid instance with id and hashid. So book.id.id and book.id.hashid.
So to answer your direct question and your example, you can get the integer IDs with:
books = Book.objects.all()[:10]
[int(id) for id in books.values_list('id', flat=True)]
# Or use the property to get a the underlying integer
[id.id for id in books.values_list('id', flat=True)]
# Or just when iterating through a list of Books you can reference either values easily
for book in books:
  print("Book {}/{}: {}".format(book.id.id, book.id.hashid, book.name))

I've thought about making the descriptor an optional setting, but haven't done any work on it, nor really plan on doing so any time soon. Hope that helps.

Thank you for the detailed response here. The thinking here makes total sense and helps quite a bit.
I also tested two other things that worked correctly. I was able to dumpdata into a fixture and reversing out the HashidAutoField just altered the field back to the id primary key, which is really nice that it's so easily reversible. It seems that beyond values_list, I have not seen any other limitations, and even that is a one liner change in the code.
Thanks again for the great tool and for the discussion! Since this isn't an issue, I'm going to close this out.

No problem, happy to help, and thanks for the kind words. =)


Remove 'java' from codeql action

Because it complains "Kotlin version 1.8.0 is too recent. CodeQL currently supports versions below 1.7.30"

@bot-gradle test and merge

I've triggered a build for you.

I've reported this to the CodeQL team.
https://ghsecuritylab.slack.com/archives/CQJN6KQHX/p1675291578740129


Support some actions that can directly copy or replace gpt output code

Now, if you want to use the code generated in gpt, you have to use the mouse to click on the button on the code block. It would be easier if shortcuts were supported.
More actions can also be supported, like the one in raycast ai

Thank you! I appreciate your input and will definitely consider it to improve the extension.

I second this request. It also would be nice to be able to see/copy the raw AI response, as the plugin sometimes misinterprets the answers.
E.g. if one asks for a markdown-formatted response and the AI generates code blocks, the markdown following the code block is converted to HTML.

Hi @chabicht
The raw AI response can be seen by opening the conversation inside the editor.

Furthermore, I am trying to improve the response rendering bit by bit.

Thanks, that tip helps a lot! :-)


VnV-03: opera-sds/repositories landing page supposed to open source

Steps to Reproduce:
Open page: https://github.com/orgs/nasa/teams/opera-sds/repositories
you will notice this page requires login & does not show public:
Expected Result: Landing page need to be open sourced and does not require login to access the repositories: Please see the following link for the test results:
https://cae-testrail.jpl.nasa.gov/testrail/index.php?/tests/view/3989253&group_by=cases:title&group_order=asc&group_id=-1

@oddes - the expected link to list public repositories for OPERA that you want to use is: https://github.com/nasa/?q=opera-
I think you can close this ticket with the alternate above link.

Thanks.


Operation timed out

Hi, I tested the simplest example in the documentation, connecting to my locally started emqx, and then sending and receiving data, but I get errors on both ends! And with the same configuration, I'm using the paho package and it's connecting and sending/receiving data just fine.
publisher.py
import asyncio

import aiomqtt

config = {
    "hostname": "<IP_ADDRESS>",
    "port": 1883,
    "username": "DMSERVER",
    "password": "DMSERVER",
    "qos": 2,
    "topic": "diamond/info",
}

async def publisher(body: dict):
    topic = config.pop('topic', '')
    qos = config.pop('qos')
    async with aiomqtt.Client(
        username=config['username'],
        password=config['password'],
        hostname=config['hostname'],
        port=config['port'],
    ) as client:
        await client.publish(topic=topic, qos=qos, payload=json.dumps(body))

if __name__ == '__main__':
    loop = asyncio.new_event_loop()
    for i in range(10):
        loop.run_until_complete(publisher({'id': i}))

subscriber.py
import json
import asyncio
import aiomqtt

config = {
    "hostname": "localhost",
    "port": 1883,
    "username": "DMSERVER",
    "password": "DMSERVER",
    "qos": 2,
    "topic": "diamond/info",
}

async def subscriber():
    topic = config.pop('topic', '')
    qos = config.pop('qos')
    while True:
        async with aiomqtt.Client(
            username=config['username'],
            password=config['password'],
            hostname=config['hostname'],
            port=config['port'],
        ) as client:
            await client.subscribe(topic=topic, qos=qos)
            async for message in client.messages:
                print(type(message.payload), message.payload)

if __name__ == '__main__':
    loop = asyncio.get_event_loop()
    loop.run_until_complete(subscriber())

error message
Exception in callback AbstractEventLoop.add_reader(732, <function Cli...001F534C15580>)
handle: <Handle AbstractEventLoop.add_reader(732, <function Cli...001F534C15580>)>
Traceback (most recent call last):
  File "C:\Python\Lib\asyncio\events.py", line 84, in _run
    self._context.run(self._callback, *self._args)
  File "C:\Python\Lib\asyncio\events.py", line 534, in add_reader
    raise NotImplementedError
NotImplementedError
Exception in callback AbstractEventLoop.add_writer(<socket.socke..., 1883, 0, 0)>, <function Cli...001F534C16D40>)
handle: <Handle AbstractEventLoop.add_writer(<socket.socke..., 1883, 0, 0)>, <function Cli...001F534C16D40>)>
Traceback (most recent call last):
  File "C:\Python\Lib\asyncio\events.py", line 84, in _run
    self._context.run(self._callback, *self._args)
  File "C:\Python\Lib\asyncio\events.py", line 540, in add_writer
    raise NotImplementedError
NotImplementedError
Traceback (most recent call last):
  File "C:\Projects\kidinsight-demos\emqtt\aio\sub.py", line 51, in <module>
    loop.run_until_complete(subscriber())
  File "C:\Python\Lib\asyncio\base_events.py", line 654, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "C:\Projects\kidinsight-demos\emqtt\aio\sub.py", line 38, in subscriber
    async with aiomqtt.Client(
  File "C:\Virtualenvs\kidinsight-demos\Lib\site-packages\aiomqtt\client.py", line 714, in __aenter__
    await self._wait_for(self._connected, timeout=None)
  File "C:\Virtualenvs\kidinsight-demos\Lib\site-packages\aiomqtt\client.py", line 493, in _wait_for
    raise MqttError(msg) from None
aiomqtt.exceptions.MqttError: Operation timed out

Refs: https://github.com/sbtinstruments/aiomqtt/issues/34
@frederikaalund @empicano

Hi there, please double check that you are using an asyncio event loop that supports the add_writer and add_reader methods.

I'll tentatively close this as there have been no further responses. If it is still a problem, please feel free to reopen! 🙂


Create the start of an FAQ page

@candicecz I created FAQs page on the readme site, but I believe we want to add the page to the main site: https://niaid-data.readme.io/docs/frequently-asked-questions


Add a workaround for another BITS code path

The fix from last week (ce9927f7327bc71ade246108a7d984deda6293fd) worked for downloading most dependencies, but there is still one BITS transfer code path, which this fix addresses.
I realize it may be better to factor this function out into a common .ps1 file, but I can't tell from the existing code whether that's really desired.

Hi @bmharper, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!

This seems like a small (but important) contribution, so no Contribution License Agreement is required at this point. Real humans will now evaluate your PR.

TTYL, MSBOT;

Thanks! I will see whether we should extract a function for the two usages of this.

Did some more tweaking. We now let nuget download the nupkg.


feat(action): add output for the latest version

This PR introduces a version output that holds the version of the latest release.
This output allows subsequent steps to retrieve and use the version string for further processing, such as updating a package.json file.

Related discussion: https://github.com/orhun/git-cliff-action/discussions/11

Thank you @orhun !


AMBARI-24535 : File View not accessible in Ambari 2.7 after enabling 3 namenodes in HDP 3.0 (nitirajrathore)

What changes were proposed in this pull request?
Instead of hardcoded 2 namenodes, configurations now accept list of comma separated namenode urls.
How was this patch tested?
Manual testing done on 3 namenode cluster. Also test cases updated.

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Ambari-Github-PullRequest-Builder/4017/
Test PASSed.

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Ambari-Github-PullRequest-Builder/4052/
Test FAILed.
Test FAILured.

retest this please

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Ambari-Github-PullRequest-Builder/4054/
Test FAILed.
Test FAILured.

LGTM

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Ambari-Github-PullRequest-Builder/4059/
Test PASSed.


How I can download the zip file

Sorry for this inconvenient but I can't find how to download the zip file :(

You can download zip file from this "Generate command" button.
FYI: how to create command video
https://twitter.com/KK_sep_TT/status/1540283495763025920

Thanks you very much, I can now download the zip files but I have another Issue
I do everything right I put the folder in Development Behavior packs and activate it in my minecraft World but when I put all the cmd's in order with the /function command nothing happens

Here I write cmd 1-2-3-4-5-6

The your logs indicate that the commands was successfully executed.
Where you execute commands?
You need to execute these commands near the specified pixel art coordinates.


Change timezone of Dockerfile to UTC

Change timezone to UTC
Motivation
More common used timezone.
Much easier debugging of logs if everyone uses same timezone.
Closes
n/a
Changes
Changed timezone in dockerfile
Test Plan
Build docker image
Run docker image
Check time
DevOps Notes
Timezone changed

Hi @WayneWayner!
Thanks for your contribution 🙂 It makes sense to have the default timezone be UTC.

known flaky test: https://github.com/spacemeshos/go-spacemesh/issues/2923
bors merge


What is the role of the rollframe module

Hello, please describe the role of rolframe in eggroll. I did not find the package eggroll-roll-pair-2.0.1.jar in the packaged lib

RollFrame is a columnar based data structure, while RollPair is k-v based.


ci: Add release version check

Since I forgot to update the version in version/version.go yesterday, I thought I'd cut another RC, this time introducing a workflow to check that the version has indeed been updated.
This workflow strips the release/v prefix from a release branch name to obtain the version number, and compares it to the version output by go run ./cmd/cometbft/ version (which should just output the version from version/version.go).

PR checklist

[ ] Tests written/updated
[ ] Changelog entry added in .changelog (we use unclog to manage our changelog)
[ ] Updated relevant documentation (docs/ or spec/) and code comments

Seems I'm going to have to introduce this on main first, backport it and then attempt to test it out.


[Bug]: SVG image rendering

Seems to not have rendered properly on the svg
https://quixotic.io/asset/0x48933E1235529732Eb8957ab64F4093d66a7e841/8

Thanks for that URL though, makes everything so much easier. Ill ping you when fixed!


VRAM optimizations

Hi, I'd like to optimize vanilla AnimateDiff's VRAM using the optimizations you made here. Would you be able to list the main commits that drove those optimizations? I'm going through the commits one by one and trying to find them!

Hey! Most of the memory optimizations are due to ComfyUI in general, and not much in my code. I would take a look at some of ComfyUI's model management code. One trick that ComfyUI uses to save memory is that when it thinks there is not enough VRAM to fit both cond and uncond, it starts to batch the cond and uncond separately (I think that's a good way to describe it). The exact code where comfy does that is here: https://github.com/comfyanonymous/ComfyUI/blob/master/comfy/samplers.py#L217C21-L217C21


mIRCLinker bugs

I use DCX 2.0 Build 1120 and all dialogs are working fine, no errors occur and on the latest version 3.1 from GitHub, when i open a dialog, click it or even i change mouse in this dialog etc. sometimes the following errors occur;
D_ERROR mIRCLinker::eval() (SendMessage() - failed)
I don't know what mIRCLinker does, but will be good if this mIRCLinker will be removed totally :)
P.S. "Enable SendMessage Server" in mIRC is enabled. Using mIRC 7.47 version

It should return a more indepth error message than that, what else does it say?

No other errors returns.. only this line:
D_ERROR mIRCLinker::eval() (SendMessage() - failed)
I have many dialogs created using only DCX (I don't use MDX or something else).. I use only DCX. So depeing the dialog and event, sometimes returns this error and no other errors return. I give an example of a short dialog where this error occur even on mouse move:
Ooooops!!!! I found the bug he he.. this bug happens when you HALT or in script events, alias you have HALT anywhere.. especially in cb_alias. So let's give you the code of my dialog and cb_alias:
dialog icon {
  title $lang(422)
  size -1 -1 $iif($theme == standart,145,142) $iif($theme == standart,76,80)
  option dbu
}
alias icon $iif($dialog(icon),dialog -v icon,dialog -m icon icon)
**alias cb_icon {
  if ($2 == sclick) {
     ...
  }
    ...
}**
on 1:dialog:icon:init:*: {
    dcx Mark icon cb_icon
    ...
}

So, if I use instead of cb_icon this code:

alias cb_icon {
if ($2 == sclick) {
...
}
halt
}

so on every event i meet error: D_ERROR mIRCLinker::eval() (SendMessage() - failed)
And one more thing:
If i use in this alias for example: if ($me != Sash) halt or i create an another subalias in it where HALT is present, depeing the event occur (sclick, mouseenter, dclick etc.) the error return: D_ERROR mIRCLinker::eval() (SendMessage() - failed)
I need to delete all HALT from all scripts and to modiy anyway where DCX is used or interfere to not make this error:  D_ERROR mIRCLinker::eval() (SendMessage() - failed)
So you have to make a thing that mIRCLinker to occur HALT mirc command in scripts. If there are no way to fix it, will be bad :(
I'll be soon whit another issue.

I don't understand, what this mIRCLinker does? :) I see no difference, excepts this error that brings bugs and discomfort :)

the /halt command is considered an error condition in msl, & should be avoided whenever possible.
Most of the time what you really wanted to use was /return


Added multi value user and lookup fields

Q
A

Bug fix?
no

New feature?
yes

New sample?
no

Related issues?
none

Added support for multi value user and lookup fields so that data can be provisioned from the template.

Hi @SiobhanBaynes, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!
You've already signed the contribution license agreement. Thanks!
The agreement was validated by Microsoft and real humans are currently evaluating your PR.
TTYL, MSBOT;

Hi Siobhan,
Looks good, we'll have a look at this PR later on. Given holidays this most likely will not be done before the next master merge.

Hi Siobhan,
Thanls for your contribution. We really appreciate your efforts and the PR has been merged.


Weird behavior of input box inside dialog.

Discussed in https://github.com/huntabyte/shadcn-svelte/discussions/183

Originally posted by theetherGit August 21, 2023
https://github.com/huntabyte/shadcn-svelte/assets/71087863/9486f316-d156-4801-94bb-1b03e0aeb829
As you can see above when a input is in focus and i move cursor over it, text get selected automatically that's not a expected behavior.

@huntabyte i found little bit more issues. And it really hard to keep with them. I think it's better to share repo access with you or showcase all the issues anywhere?

One more addition
https://github.com/huntabyte/shadcn-svelte/assets/71087863/75699671-6eeb-45e2-8f5f-fde8c76763df
When a dialog box is open and press spacebar it get closed. Nothing just closes it self only in dialog box.
https://github.com/huntabyte/shadcn-svelte/assets/71087863/cf8f7352-d379-4aa9-97ab-1b845d90b6b0
In this i'm pressing spacebar and it's not taking it as input.

@huntabyte i found little bit more issues. And it really hard to keep with them. I think it's better to share repo access with you or showcase all the issues anywhere?

@theetherGit thanks for pointing these out! We are working on all of these as we speak! If you wouldn't mind opening an individual issue for each so we can resolve them each!

No worries at all! Is this issue good to close? @theetherGit

yes not just this one other too i have created them in issue too.


[Feature request] Cylindrical sampling scheme

In CMB data analysis (aiming at probing small angular scales), an interest has been growing towards cylindrical griding, named CAR in https://phy-act1.princeton.edu/public/saiola/act_dr4_C20.pdf or ECP in https://www.aanda.org/articles/aa/full_html/2013/08/aa21575-13/aa21575-13.html. It corresponds to a rectangular projection, equi-spaced in latitude, and not equal-area projection, but with the same number of pixels per ring, and relies on Clenshaw-Curtis quadrature weightings for the associated transforms.
This sampling scheme is the baseline one used for the ACT (Atacama Cosmology Telescope) collaboration and central in many tools developed for the LAT analysis in the Simons Observatory collaboration (in which I am part of).
I wanted to ask if it would be possible to have s2fft support for such sampling scheme.

Thanks @Magwos, sounds like a very useful feature. We can certainly add this. Note that MW/DH equiangular sampling is already supported but I appreciate you probably want exactly the same sampling as used elsewhere.
Do you have a reference (paper and/or code) with the precise details of the sampling? I had a super quick look at the references you posted but didn't immediately see the details there.

Thanks a lot for your positive answer!
So, currently the implementation that is most used is done through the package https://github.com/simonsobs/pixell (in particular https://github.com/simonsobs/pixell/blob/master/pixell/curvedsky.py), which itself calls the ducc package (https://mtr.pages.mpcdf.de/ducc/sht.html#module-ducc0.sht) for their transforms.
An example of CMB-science oriented package calling pixell is this one: https://github.com/simonsobs/pspy
Pspy is mostly used towards small-scale science, and it is usually applied to partial sky maps with very high resolution (typically nside=4096, the SO LAT will have a resolution of 1 arcmin), storing only the relevant pixels and not the 0 of the unobserved area (and of course the coordinates of the patch observed).
If you need more details about all of this, please let me know.

Thanks @Magwos !
Adding further details from your email that you sent separately so we have everything here in one place.

there is no paper detailing this CAR pixelisation which was adopted by ACT (named after the Plate-Carré projection, or Equirectangular one), as it corresponds in fact to the ECP (equidistant cylindrical projection) grid also detailed here: https://www.aanda.org/articles/aa/pdf/2013/06/aa21494-13.pdf (4.1.1)


fix(eval): BEIR download

Description
Fix broken download due to whitespace and slightly better error handling.
Type of Change
Please delete options that are not relevant.

[X] Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

[X] Added new notebook (that tests end-to-end)

Suggested Checklist:

[X] New and existing unit tests pass locally with my changes

Looks good to me!


[VS Code] Starting collaboration session: Already connected to a workspace.

Error:
Starting collaboration session: Already connected to a workspace.
Steps to Reproduce:
1.
2.

Version Data

extensionName
VSLS

extensionVersion
1.0.470

protocolVersion
2.2

applicationName
VSCode

applicationVersion
1.36.0-insider

platformName
Windows

platformVersion
10.0.17763

We are aware of the issue and working on a fix. Closing as a duplicate of #2359. Thanks for using LiveShare!

We published a new release of the extension to the marketplace which contains a fix for this issue. The version number is 1.0.471. Please update your extension in Visual Studio Code. Thanks everyone for the feedback!


Link at the bottom of README is broken

$ curl https://nanobox.io/open-source -I
HTTP/1.1 404 Not Found
Content-Length: 169
Content-Type: text/html
Date: Tue, 20 Jun 2017 07:38:02 GMT
Server: nginx/1.12.0

it is 404.

Sorry about that! The page was removed around the time Nanobox came out of beta, and hasn't been re-created, yet.

Talked to Scott and he will get that created. Thanks for reporting

I'll get this fixed, thanks for the catch @hvnsweeting

Looks like this page has life again, thanks everyone.


Multiple accessories

Hello, I'm trying to use my esp with your homekit library in order to control two different devices, a fan and a light, both connected to one single esp.
When creating the accessories array, I add a second accessory with .id=2, and all its relative services and information.
The firmware compiles fine but when I try to add the two accessories to my home, I am only able to see the first one (with id 1). Moreover it fails to pair, menaing that as soon as the pairing setup is finished, the esp recives an unpair command from homekit and deletes the pairing, resulting in a pair error in home app.
What am I doing wrong?
Thank you!

Must be something in your code, I have a setup with 4 acc (id 1-4) that works fine.

Could you please provide an example? I cannot really figure out what I am doing wrong. Do you also know if it is possible to dynamically add accessories? Like i connect something to my esp that has the capability to manage other devices (like another light) but then show it in home app only when I actually connet it to my esp

The best way is to use an unique accessory (.id=1), with one or more services (fan and light are services). And remember to check the required characteristic of each service, documented here: https://github.com/maximkulkin/esp-homekit/blob/master/include/homekit/characteristics.h

@sn0wst0rm That does not work that way: you can not change list accessories dynamically at runtime (at least, this is not an officially supported behavior).

@RavenSystem yes I've noticed it, using multiple accessory IDs does not work at all, causing accessory pair failure. In addition I can't see how to add a specific password for each of the accessories in the accessories array.
@maximkulkin I meant something like it happens in Homebridge, if one of the plugins discovers a new device, next time you open the home app it shows in the default room and you can use it

@maximkulkin I meant something like it happens in Homebridge, if one of the plugins discovers a new device, next time you open the home app it shows in the default room and you can use it

The specific behavior would be very interested to implement in combination with OTA updates.

@supersjimmie could you please share the code were you have 4 different accessories?

@royfocker19 you may want to check the following:
https://github.com/peros550/esp-homekit-multiple-sensors

Nice example, I'm doing something wrong. I can compile it. connect to the AP and the to my wireless, but I cannot add the accessories, nothing appears when I want to add them and the led on the ESP doesn't stop blinking.

@royfocker19 that is pretty straight forward, just repeat things until you have them all.
Use a new .id for each accessory.
(and don't forget all the NULLs!)
homekit_accessory_t *accessories[] = {
    HOMEKIT_ACCESSORY(.id=1, .category=homekit_accessory_category_switch, .services=(homekit_service_t*[]){
        HOMEKIT_SERVICE(ACCESSORY_INFORMATION, .characteristics=(homekit_characteristic_t*[]){
            HOMEKIT_CHARACTERISTIC(NAME, "MYNAME"),
            HOMEKIT_CHARACTERISTIC(MANUFACTURER, "HaPK"),
            HOMEKIT_CHARACTERISTIC(SERIAL_NUMBER, "037A2BABF19D"),
            HOMEKIT_CHARACTERISTIC(MODEL, "supersjimmie"),
            HOMEKIT_CHARACTERISTIC(FIRMWARE_REVISION, "0.1"),
            HOMEKIT_CHARACTERISTIC(IDENTIFY, NULL),
            NULL
        }),
        HOMEKIT_SERVICE(LIGHTBULB, .primary=false, .characteristics=(homekit_characteristic_t*[]){
            HOMEKIT_CHARACTERISTIC(NAME, "Room1"),
			&dimbtn3,
			NULL
        }),
        HOMEKIT_SERVICE(LIGHTBULB, .primary=true, .characteristics=(homekit_characteristic_t*[]){
            HOMEKIT_CHARACTERISTIC(NAME, "Room2"),
			&dimbtn4,
			NULL
        }),
        NULL
    }),

    HOMEKIT_ACCESSORY(.id=2, .category=homekit_accessory_category_thermostat, .services=(homekit_service_t*[]) {
        HOMEKIT_SERVICE(ACCESSORY_INFORMATION, .characteristics=(homekit_characteristic_t*[]) {
            HOMEKIT_CHARACTERISTIC(NAME, "Thermostat"),
            HOMEKIT_CHARACTERISTIC(MANUFACTURER, "HaPK"),
            HOMEKIT_CHARACTERISTIC(SERIAL_NUMBER, "0012346"),
            HOMEKIT_CHARACTERISTIC(MODEL, "Sensors"),
            HOMEKIT_CHARACTERISTIC(FIRMWARE_REVISION, "0.1"),
            HOMEKIT_CHARACTERISTIC(IDENTIFY, NULL),
            NULL
        }),
        HOMEKIT_SERVICE(THERMOSTAT, .characteristics=(homekit_characteristic_t*[]) {
            HOMEKIT_CHARACTERISTIC(NAME, "Airco"),
            &temperature,
//            &humidity,
            &heatstatecurrent,
            &heatstatetarget,
            &temptarget,
            &tempunits,
            NULL
        }),

		NULL
	}),

    HOMEKIT_ACCESSORY(.id=3, .category=homekit_accessory_category_sensor, .services=(homekit_service_t*[]) {
        HOMEKIT_SERVICE(ACCESSORY_INFORMATION, .characteristics=(homekit_characteristic_t*[]) {
            HOMEKIT_CHARACTERISTIC(NAME, "Sensors"),
            HOMEKIT_CHARACTERISTIC(MANUFACTURER, "HaPK"),
            HOMEKIT_CHARACTERISTIC(SERIAL_NUMBER, "0012347"),
            HOMEKIT_CHARACTERISTIC(MODEL, "Sensors"),
            HOMEKIT_CHARACTERISTIC(FIRMWARE_REVISION, "0.1"),
            HOMEKIT_CHARACTERISTIC(IDENTIFY, NULL),
            NULL
        }),
        HOMEKIT_SERVICE(HUMIDITY_SENSOR, .characteristics=(homekit_characteristic_t*[]) {
            HOMEKIT_CHARACTERISTIC(NAME, "Humidity"),
            &humidity,
            NULL
        }),

        HOMEKIT_SERVICE(AIR_QUALITY_SENSOR, .primary=true, .characteristics=(homekit_characteristic_t*[]) {
            HOMEKIT_CHARACTERISTIC(NAME, "Lucht"),
            &airquality,
			&co2value,
            NULL
        }),
		NULL
	}),

	HOMEKIT_ACCESSORY(.id=4, .category=homekit_accessory_category_sensor, .services=(homekit_service_t*[]) {
        HOMEKIT_SERVICE(ACCESSORY_INFORMATION, .characteristics=(homekit_characteristic_t*[]) {
            HOMEKIT_CHARACTERISTIC(NAME, "Light"),
            HOMEKIT_CHARACTERISTIC(MANUFACTURER, "HaPK"),
            HOMEKIT_CHARACTERISTIC(SERIAL_NUMBER, "0012349"),
            HOMEKIT_CHARACTERISTIC(MODEL, "LightSensor"),
            HOMEKIT_CHARACTERISTIC(FIRMWARE_REVISION, "0.1"),
            HOMEKIT_CHARACTERISTIC(IDENTIFY, NULL),
            NULL
        }),
        HOMEKIT_SERVICE(LIGHT_SENSOR, .characteristics=(homekit_characteristic_t*[]) {
            HOMEKIT_CHARACTERISTIC(NAME, "Licht"),
            &lightvalue,
            NULL
        }),
		NULL
	}),

    NULL
};

@royfocker19 had a similar issue as you described. It turned out for me that my code didn't properly initialize a Light sensor value (withing the default range expected by homekit)  hence I was not able to add it in homekit during the pairing process. I did a lot of troubleshooting to indentify the issue. I was adding one by one my accessories to code, then compile, then try and error to identify what was the root cause of my issue.  What kind of sensors are you trying to integrate?

I’m just adding 2 lightbulbs. Because I want them in different rooms they need to be 2 different accessories. It seems the second accessory is not initializing. I’ll share my code in a few minutes.

#include <stdio.h>
#include <espressif/esp_wifi.h>
#include <espressif/esp_sta.h>
#include <espressif/esp_common.h>
#include <esp/uart.h>
#include <esp8266.h>
#include <FreeRTOS.h>
#include <task.h>
#include <homekit/homekit.h>
#include <homekit/characteristics.h>
#include <wifi_config.h>
#include "button.h"
#include "toggle.h"
// The GPIO pin that is connected to Triac#1 on the ESP12F V3.
const int relay_gpio_1 = 14;
// The GPIO pin that is connected to Triac#2 on the ESP12F V3.
const int relay_gpio_2 = 16;
// The GPIO pin that is connected to the LED on the ESP12F V3.
const int led_gpio = 2;
// The GPIO pin that is connected to the button on the ESP12F V3.
const int button_gpio = 0;
// The GPIO pin that is connected to the header on the ESP12F V3 (external switches).
const int toggle_gpio_1 = 12;
const int toggle_gpio_2 = 13;
homekit_characteristic_t name = HOMEKIT_CHARACTERISTIC_(NAME, "ESP12F V3");
void light_identify_task(void *_args) {
// We identify the ESP12F by flashing it's LED.
for (int i=0; i<3; i++) {
for (int j=0; j<2; j++) {
led_write(true);
vTaskDelay(200 / portTICK_PERIOD_MS);
led_write(false);
vTaskDelay(200 / portTICK_PERIOD_MS);
}
vTaskDelay(500 / portTICK_PERIOD_MS);
}
led_write(false);
vTaskDelete(NULL);
}
void light_identify(homekit_value_t _value) {
printf("Light identify\n");
xTaskCreate(light_identify_task, "Light identify", 128, NULL, 2, NULL);
}
void button_callback(uint8_t gpio, button_event_t event);
void led_write(bool on) {
gpio_write(led_gpio, on ? 0 : 1);
}
void reset_configuration_task() {
//Flash LED first before we start the reset
for (int i=0; i<3; i++) {
led_write(true);
vTaskDelay(100 / portTICK_PERIOD_MS);
led_write(false);
vTaskDelay(100 / portTICK_PERIOD_MS);
}
printf("Resetting Wifi   due to button long   at GPIO %2d\n", button_gpio);
wifi_config_reset();
vTaskDelay(1000 / portTICK_PERIOD_MS);
printf("Resetting HomeKit Config\n");
homekit_server_reset();
vTaskDelay(1000 / portTICK_PERIOD_MS);
printf("Restarting\n");
sdk_system_restart();
vTaskDelete(NULL);
}
void reset_configuration() {
printf("Resetting ESP12F V3 configuration\n");
xTaskCreate(reset_configuration_task, "Reset configuration", 256, NULL, 2, NULL);
}
void lightbulb_on_1_callback(homekit_characteristic_t *_ch, homekit_value_t on, void *context);
void switch_on_1_callback(homekit_characteristic_t *_ch, homekit_value_t on, void *context);
void toggle_callback_1(uint8_t gpio);
void toggle_callback_2(uint8_t gpio);
void relay_write_1(bool on) {
gpio_write(relay_gpio_1, on ? 1 : 0);
}
void relay_write_2(bool on) {
gpio_write(relay_gpio_2, on ? 1 : 0);
}
homekit_characteristic_t lightbulb_on_1 = HOMEKIT_CHARACTERISTIC_(
ON, false, .callback=HOMEKIT_CHARACTERISTIC_CALLBACK(lightbulb_on_1_callback)
);
homekit_characteristic_t switch_on_1 = HOMEKIT_CHARACTERISTIC_(
ON, false, .callback=HOMEKIT_CHARACTERISTIC_CALLBACK(switch_on_1_callback)
);
void lightbulb_on_1_callback(homekit_characteristic_t *_ch, homekit_value_t on, void *context) {
relay_write_1(lightbulb_on_1.value.bool_value);
}
void button_callback(uint8_t gpio, button_event_t event) {
switch (event) {
case button_event_single_press:
printf("Toggling Triac 1 due to button short  at GPIO %2d\n", gpio);
lightbulb_on_1.value.bool_value = !lightbulb_on_1.value.bool_value;
relay_write_1(lightbulb_on_1.value.bool_value);
homekit_characteristic_notify(&lightbulb_on_1, lightbulb_on_1.value);
break;
case button_event_medium_press:
printf("Toggling Triac 2 due to button medium at GPIO %2d\n", gpio);
switch_on_1.value.bool_value = !switch_on_1.value.bool_value;
relay_write_2(switch_on_1.value.bool_value);
homekit_characteristic_notify(&switch_on_1, switch_on_1.value);
break;
case button_event_long_press:
reset_configuration();
break;
default:
printf("Unknown button event: %d\n", event);
}
}
void switch_on_1_callback(homekit_characteristic_t *_ch, homekit_value_t on, void *context) {
relay_write_2(switch_on_1.value.bool_value);
}
void identify(homekit_value_t _value) {
printf("identify\n");
xTaskCreate(identify_task, "identify", 128, NULL, 2, NULL);
}
void identify_task(void *_args) {
vTaskDelete(NULL);
}
void toggle_callback_1(uint8_t gpio) {
printf("Toggling Triac 1 due to switch at GPIO %2d\n", gpio);
lightbulb_on_1.value.bool_value = !lightbulb_on_1.value.bool_value;
relay_write_1(lightbulb_on_1.value.bool_value);
homekit_characteristic_notify(&lightbulb_on_1, lightbulb_on_1.value);
}
void toggle_callback_2(uint8_t gpio) {
printf("Toggling Triac 2 due to switch at GPIO %2d\n", gpio);
switch_on_1.value.bool_value = !switch_on_1.value.bool_value;
relay_write_2(switch_on_1.value.bool_value);
homekit_characteristic_notify(&switch_on_1, switch_on_1.value);
}
homekit_accessory_t accessories[] = {
HOMEKIT_ACCESSORY(.id=1, .category=homekit_accessory_category_switch, .services=(homekit_service_t[]) {
HOMEKIT_SERVICE(ACCESSORY_INFORMATION, .characteristics=(homekit_characteristic_t*[]) {
HOMEKIT_CHARACTERISTIC(IDENTIFY, light_identify),
HOMEKIT_CHARACTERISTIC(MANUFACTURER, "LKAI"),
HOMEKIT_CHARACTERISTIC(MODEL, "ESP12F V13"),
&name,
HOMEKIT_CHARACTERISTIC(SERIAL_NUMBER, "mps"),
HOMEKIT_CHARACTERISTIC(FIRMWARE_REVISION, "0.1"),
HOMEKIT_CHARACTERISTIC(HARDWARE_REVISION, "V3"),
NULL
}),
HOMEKIT_SERVICE(LIGHTBULB, .primary=true, .characteristics=(homekit_characteristic_t*[]) {
HOMEKIT_CHARACTERISTIC(NAME, "Light 1"),
&lightbulb_on_1,
NULL
}),
}),

HOMEKIT_ACCESSORY(.id=2, .category=homekit_accessory_category_switch, .services=(homekit_service_t*[]){
HOMEKIT_SERVICE(ACCESSORY_INFORMATION, .characteristics=(homekit_characteristic_t*[]){
HOMEKIT_CHARACTERISTIC(IDENTIFY, identify),
HOMEKIT_CHARACTERISTIC(MANUFACTURER, "LKAI"),
HOMEKIT_CHARACTERISTIC(MODEL, "ESP12F V3"),
HOMEKIT_CHARACTERISTIC(NAME, "ESP12F V3"),
HOMEKIT_CHARACTERISTIC(SERIAL_NUMBER, "mps2"),
HOMEKIT_CHARACTERISTIC(FIRMWARE_REVISION, "0.1"),
HOMEKIT_CHARACTERISTIC(HARDWARE_REVISION, "V3"),
NULL
}),
HOMEKIT_SERVICE(SWITCH, .primary=true, .characteristics=(homekit_characteristic_t*[]){
    HOMEKIT_CHARACTERISTIC(NAME, "Light 2"),
        &switch_on_1,

        NULL
    }),

    NULL
}),

};
void create_accessory_name() {
uint8_t macaddr[6];
sdk_wifi_get_macaddr(STATION_IF, macaddr);
int name_len = snprintf(NULL, 0, "ESP12F V3 %02X:%02X:%02X",
                        macaddr[3], macaddr[4], macaddr[5]);
char *name_value = malloc(name_len+1);
snprintf(name_value, name_len+1, "ESP12F V3 %02X:%02X:%02X",
         macaddr[3], macaddr[4], macaddr[5]);

name.value = HOMEKIT_STRING(name_value);

}
homekit_server_config_t config = {
.accessories = accessories,
.password = "111-11-111"
};
void on_wifi_ready() {
homekit_server_init(&config);
}
void gpio_init() {
gpio_enable(led_gpio, GPIO_OUTPUT);
led_write(false);
gpio_enable(relay_gpio_1, GPIO_OUTPUT);
relay_write_1(lightbulb_on_1.value.bool_value);

gpio_enable(relay_gpio_2, GPIO_OUTPUT);
relay_write_2(switch_on_1.value.bool_value);

gpio_enable(button_gpio,   GPIO_INPUT);
gpio_enable(toggle_gpio_1, GPIO_INPUT);
gpio_enable(toggle_gpio_2, GPIO_INPUT);

}
void user_init(void) {
uart_set_baud(0, 115200);
wifi_config_init("ESP12F V3", NULL, on_wifi_ready);
gpio_init();
create_accessory_name();
// 4000 = 4s long press => 4000/4 = 1s medium press
if (button_create(button_gpio, 0, 4000, button_callback)) {
printf("Failed to initialize button\n");
}
if (toggle_create(toggle_gpio_1, toggle_callback_1)) {
    printf("Failed to initialize toggle 1 \n");
}

if (toggle_create(toggle_gpio_2, toggle_callback_2)) {
    printf("Failed to initialize toggle 2 \n");
}

}

Am I missing some Null or something?

I think there were 3 NULLs missing....

yep,  just like I suggested: "don't forget all the NULLs!".  👍

Something that I don't understand is why the accessories appear in a
different order from the one in the code.
Regards
Fede
On Fri, Aug 17, 2018 at 8:50 AM, supersjimmie<EMAIL_ADDRESS>wrote:

yep, just like I suggested: "don't forget all the NULLs!". 👍
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/maximkulkin/esp-homekit-demo/issues/102#issuecomment-413841262,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AlfHiE87o1lR2NJvPY3YFaCtZzoxwqR0ks5uRq4VgaJpZM4U1e5N
.

Ok, it worked, final code is this.
#include <stdio.h>
#include <espressif/esp_wifi.h>
#include <espressif/esp_sta.h>
#include <espressif/esp_common.h>
#include <esp/uart.h>
#include <esp8266.h>
#include <FreeRTOS.h>
#include <task.h>
#include <homekit/homekit.h>
#include <homekit/characteristics.h>
#include <wifi_config.h>
#include "button.h"
#include "toggle.h"
// The GPIO pin that is connected to triac#1 on the ESP12F V3.
const int triac_gpio_1 = 14;
// The GPIO pin that is connected to triac#2 on the ESP12F V3.
const int triac_gpio_2 = 16;
// The GPIO pin that is connected to the LED on the ESP12F V3.
const int led_gpio = 2;
// The GPIO pin that is connected to the button on the ESP12F V3.
const int button_gpio = 0;
// The GPIO pin that is connected to the header on the ESP12F V3 (external switch).
const int toggle_gpio_1 = 12;
const int toggle_gpio_2 = 13;
homekit_characteristic_t name = HOMEKIT_CHARACTERISTIC_(NAME, "ESP12F V3");
void led_write(bool on) {
gpio_write(led_gpio, on ? 0 : 1);
}
void light_identify_task(void *_args) {
// We identify the ESP12F by Flashing it's LED.
for (int i=0; i<3; i++) {
for (int j=0; j<2; j++) {
led_write(true);
vTaskDelay(200 / portTICK_PERIOD_MS);
led_write(false);
vTaskDelay(200 / portTICK_PERIOD_MS);
}
vTaskDelay(500 / portTICK_PERIOD_MS);
}
led_write(false);
vTaskDelete(NULL);
}
void light_identify(homekit_value_t _value) {
printf("Light identify\n");
xTaskCreate(light_identify_task, "Light identify", 128, NULL, 2, NULL);
}
void button_callback(uint8_t gpio, button_event_t event);
void reset_configuration_task() {
//Flash LED first before we start the reset
for (int i=0; i<3; i++) {
led_write(true);
vTaskDelay(100 / portTICK_PERIOD_MS);
led_write(false);
vTaskDelay(100 / portTICK_PERIOD_MS);
}
printf("Resetting Wifi due to button long at GPIO %2d\n", button_gpio);
wifi_config_reset();
vTaskDelay(1000 / portTICK_PERIOD_MS);
printf("Resetting HomeKit Config\n");
homekit_server_reset();
vTaskDelay(1000 / portTICK_PERIOD_MS);
printf("Restarting\n");
sdk_system_restart();
vTaskDelete(NULL);
}
void reset_configuration() {
printf("Resetting ESP12F V3 configuration\n");
xTaskCreate(reset_configuration_task, "Reset configuration", 256, NULL, 2, NULL);
}
void lightbulb_on_1_callback(homekit_characteristic_t *_ch, homekit_value_t on, void *context);
void lightbulb_on_2_callback(homekit_characteristic_t *_ch, homekit_value_t on, void *context);
void toggle_callback_1(uint8_t gpio);
void toggle_callback_2(uint8_t gpio);
void triac_write_1(bool on) {
gpio_write(triac_gpio_1, on ? 1 : 0);
}
void triac_write_2(bool on) {
gpio_write(triac_gpio_2, on ? 1 : 0);
}
homekit_characteristic_t lightbulb_on_1 = HOMEKIT_CHARACTERISTIC_(
ON, false, .callback=HOMEKIT_CHARACTERISTIC_CALLBACK(lightbulb_on_1_callback)
);
homekit_characteristic_t lightbulb_on_2 = HOMEKIT_CHARACTERISTIC_(
ON, false, .callback=HOMEKIT_CHARACTERISTIC_CALLBACK(lightbulb_on_2_callback)
);
void lightbulb_on_1_callback(homekit_characteristic_t *_ch, homekit_value_t on, void *context) {
triac_write_1(lightbulb_on_1.value.bool_value);
}
void lightbulb_on_2_callback(homekit_characteristic_t *_ch, homekit_value_t on, void *context) {
triac_write_2(lightbulb_on_2.value.bool_value);
}
void button_callback(uint8_t gpio, button_event_t event) {
switch (event) {
case button_event_single_press:
printf("Toggling triac 1 due to button short at GPIO %2d\n", gpio);
lightbulb_on_1.value.bool_value = !lightbulb_on_1.value.bool_value;
triac_write_1(lightbulb_on_1.value.bool_value);
homekit_characteristic_notify(&lightbulb_on_1, lightbulb_on_1.value);
break;
case button_event_medium_press:
printf("Toggling triac 2 due to button medium at GPIO %2d\n", gpio);
lightbulb_on_2.value.bool_value = !lightbulb_on_2.value.bool_value;
triac_write_2(lightbulb_on_2.value.bool_value);
homekit_characteristic_notify(&lightbulb_on_2, lightbulb_on_2.value);
break;
case button_event_long_press:
reset_configuration();
break;
default:
printf("Unknown button event: %d\n", event);
}
}
//void identify_task(void *_args) {
// vTaskDelete(NULL);
//}
//void identify(homekit_value_t _value) {
// printf("identify\n");
// xTaskCreate(identify_task, "identify", 128, NULL, 2, NULL);
//}
void light2_identify_task(void *_args) {
// We identify the ESP12F by Flashing it's LED.
for (int i=0; i<3; i++) {
for (int j=0; j<2; j++) {
led_write(true);
vTaskDelay(200 / portTICK_PERIOD_MS);
led_write(false);
vTaskDelay(200 / portTICK_PERIOD_MS);
}
vTaskDelay(500 / portTICK_PERIOD_MS);
}
led_write(false);
vTaskDelete(NULL);
}
void light2_identify(homekit_value_t _value) {
printf("Light identify\n");
xTaskCreate(light2_identify_task, "Light identify", 128, NULL, 2, NULL);
}
void toggle_callback_1(uint8_t gpio) {
printf("Toggling triac 1 due to switch at GPIO %2d\n", gpio);
lightbulb_on_1.value.bool_value = !lightbulb_on_1.value.bool_value;
triac_write_1(lightbulb_on_1.value.bool_value);
homekit_characteristic_notify(&lightbulb_on_1, lightbulb_on_1.value);
}
void toggle_callback_2(uint8_t gpio) {
printf("Toggling triac 2 due to switch at GPIO %2d\n", gpio);
lightbulb_on_2.value.bool_value = !lightbulb_on_2.value.bool_value;
triac_write_2(lightbulb_on_2.value.bool_value);
homekit_characteristic_notify(&lightbulb_on_2, lightbulb_on_2.value);
}
homekit_accessory_t accessories[] = { HOMEKIT_ACCESSORY(.id=1, .category=homekit_accessory_category_switch, .services=(homekit_service_t[]) {
HOMEKIT_SERVICE(ACCESSORY_INFORMATION, .characteristics=(homekit_characteristic_t*[]) {
HOMEKIT_CHARACTERISTIC(IDENTIFY, light_identify),
HOMEKIT_CHARACTERISTIC(MANUFACTURER, "LKAI"),
HOMEKIT_CHARACTERISTIC(MODEL, "ESP12F V3"),
&name,
HOMEKIT_CHARACTERISTIC(SERIAL_NUMBER, "mps"),
HOMEKIT_CHARACTERISTIC(FIRMWARE_REVISION, "0.1"),
HOMEKIT_CHARACTERISTIC(HARDWARE_REVISION, "V3"),
NULL
}),
HOMEKIT_SERVICE(LIGHTBULB, .primary=true, .characteristics=(homekit_characteristic_t*[]) {
HOMEKIT_CHARACTERISTIC(NAME, "Light 1"),
    &lightbulb_on_1,
        NULL
    }),
   NULL
}),

HOMEKIT_ACCESSORY(.id=2, .category=homekit_accessory_category_switch, .services=(homekit_service_t*[]){
HOMEKIT_SERVICE(ACCESSORY_INFORMATION, .characteristics=(homekit_characteristic_t*[]){
HOMEKIT_CHARACTERISTIC(IDENTIFY, light2_identify),
HOMEKIT_CHARACTERISTIC(MANUFACTURER, "LKAI"),
HOMEKIT_CHARACTERISTIC(MODEL, "ESP12F V3"),
HOMEKIT_CHARACTERISTIC(NAME, "ESP12F V3"),
HOMEKIT_CHARACTERISTIC(SERIAL_NUMBER, "mps2"),
HOMEKIT_CHARACTERISTIC(FIRMWARE_REVISION, "0.1"),
HOMEKIT_CHARACTERISTIC(HARDWARE_REVISION, "V3"),
NULL
}),
HOMEKIT_SERVICE(LIGHTBULB, .primary=true, .characteristics=(homekit_characteristic_t*[]){
    HOMEKIT_CHARACTERISTIC(NAME, "Light 2"),
        &lightbulb_on_2,

        NULL
    }),

    NULL
}),

NULL

};
void create_accessory_name() {
uint8_t macaddr[6];
sdk_wifi_get_macaddr(STATION_IF, macaddr);
int name_len = snprintf(NULL, 0, "ESP12F V3 %02X:%02X:%02X",
                        macaddr[3], macaddr[4], macaddr[5]);
char *name_value = malloc(name_len+1);
snprintf(name_value, name_len+1, "ESP12F V3 %02X:%02X:%02X",
         macaddr[3], macaddr[4], macaddr[5]);

name.value = HOMEKIT_STRING(name_value);

}
homekit_server_config_t config = {
.accessories = accessories,
.password = "111-11-111"
};
void on_wifi_ready() {
homekit_server_init(&config);
}
void gpio_init() {
gpio_enable(led_gpio, GPIO_OUTPUT);
led_write(false);
gpio_enable(triac_gpio_1, GPIO_OUTPUT);
triac_write_1(lightbulb_on_1.value.bool_value);

gpio_enable(triac_gpio_2, GPIO_OUTPUT);
triac_write_2(lightbulb_on_2.value.bool_value);

gpio_enable(button_gpio,   GPIO_INPUT);
gpio_enable(toggle_gpio_1, GPIO_INPUT);
gpio_enable(toggle_gpio_2, GPIO_INPUT);

}
void user_init(void) {
uart_set_baud(0, 115200);
wifi_config_init("ESP12F V3", NULL, on_wifi_ready);
gpio_init();
create_accessory_name();
// 4000 = 4s long press => 4000/4 = 1s medium press
if (button_create(button_gpio, 0, 4000, button_callback)) {
printf("Failed to initialize button\n");
}
if (toggle_create(toggle_gpio_1, toggle_callback_1)) {
    printf("Failed to initialize toggle 1 \n");
}

if (toggle_create(toggle_gpio_2, toggle_callback_2)) {
    printf("Failed to initialize toggle 2 \n");
}

}

Hello,
Thank you for sharing this, I keep getting errors trying to apply this code, would you mind sharing the whole directory files please ?
also can we increase the number of relays controlled by this to say 10 ?

I would like to use 5 different sonoff basic application in my home.
5 different sonoff, 5 different esp8266. Should I change anything on code? If I program all of them with same sonoff_basic example code, Do they conflict?

@okanduzyel  You should be fine with flashing same firmware to all of them

I am flashing the same image to a couple esp8266's and only one is showing up on Home app.. But when I change the Name characteristic to something unique, the second one shows up. I tried just incrementing the Serial Number, but that didn't solve the problem like changing the Name did. Any ideas on why?

Could you please share the code? It’s a multiple accessory like the one discussed here?

@spxnr by writing here I think you're confusing what "multiple accessories" meant by original issue author. He meant the case when you configure esp-homekit with an array of more than one accessory, so single device acts as many accessories. Your problem as far as I understand is making multiple devices co-exist in the same network. I do not know which firmware you're trying to use (my guess is your own one), so I suggest checking something like sonoff_basic firmware handles name uniqueness.

@maximkulkin hi, i just start to use esp32 and i use your code about esp32 homekit (builtin_led_accessory) , i confused about to use multiple switch, do you have any suggestion, or do you have any example about it, i just want to control 8 relay with esp32 and homekit, i try to understand royfocker19's code but i fail. so many library doesent exist in my arduino ide. and the code for esp8266.

Share your code so I can truly to check it

@royfocker19  im really level 0 person about esp and my code is ;
2 pin control with esp.txt
/*

builtin_led_accessory.c
Define the accessory in pure C language using the Macro in characteristics.h

Created on: 2020-04-13

 Author: Mixiaoxiao (Wang Bin)

*/
#include <Arduino.h>
#include <homekit/types.h>
#include <homekit/homekit.h>
#include <homekit/characteristics.h>
#include <stdio.h>
#include <port.h>
#include <esp_wifi_types.h>
#include <esp_wifi.h>
static char ACCESSORY_NAME[33] = "TT AKILLI EV SİSTEMİ 2";
#define ACCESSORY_SN  ("00002")  //SERIAL_NUMBER
#define ACCESSORY_MANUFACTURER ("Tarkan TAŞKIN")
#define ACCESSORY_MODEL  ("LED 2")
#define PIN_LED2 23
static char ACCESSORY_NAME[32] = "TT AKILLI EV SİSTEMİ";
#define ACCESSORY_SN  ("00001")  //SERIAL_NUMBER
#define ACCESSORY_MANUFACTURER ("Tarkan TAŞKIN")
#define ACCESSORY_MODEL  ("LED")
#define PIN_LED 2
void led_set_power(bool on) {
digitalWrite(PIN_LED, on ? HIGH : LOW);
digitalWrite(PIN_LED2, on ? HIGH : LOW);
}
void led_setter(homekit_value_t value);
homekit_characteristic_t name = HOMEKIT_CHARACTERISTIC_(NAME, ACCESSORY_NAME);
homekit_characteristic_t serial_number = HOMEKIT_CHARACTERISTIC_(SERIAL_NUMBER, ACCESSORY_SN);
homekit_characteristic_t led_on = HOMEKIT_CHARACTERISTIC_(ON, false, .setter=led_setter);
void led_setter(homekit_value_t value) {
if (value.format != homekit_format_bool) {
printf("Invalid on-value format: %d\n", value.format);
return;
}
const bool power = value.bool_value;
led_on.value.bool_value = power; // Sync the value, and no getter needed.
led_set_power(power);
printf("Set Builtin-LED to %s\n", power ? "ON" : "OFF");
}
void led_toggle() {
bool power = !led_on.value.bool_value;
led_on.value.bool_value = power;
led_set_power(power);
homekit_characteristic_notify(&led_on, led_on.value);
}
void led_blink_task(void *_args) {
for (int i = 0; i < 3; i++) {
led_set_power(true);
vTaskDelay(100 / portTICK_PERIOD_MS);
led_set_power(false);
vTaskDelay(100 / portTICK_PERIOD_MS);
}
led_set_power(false);
vTaskDelete(NULL);
}
void led_blink() {
xTaskCreate(led_blink_task, "led_blink_task", 2048, NULL, 1, NULL);
}
void accessory_identify(homekit_value_t _value) {
printf("accessory identify\n");
led_blink();
}
homekit_accessory_t accessories[] = {
HOMEKIT_ACCESSORY(
.id = 1,
.category = homekit_accessory_category_lightbulb,
.services=(homekit_service_t[]){
HOMEKIT_SERVICE(ACCESSORY_INFORMATION,
.characteristics=(homekit_characteristic_t*[]){
&name,
HOMEKIT_CHARACTERISTIC(MANUFACTURER, ACCESSORY_MANUFACTURER),
&serial_number,
HOMEKIT_CHARACTERISTIC(MODEL, ACCESSORY_MODEL),
HOMEKIT_CHARACTERISTIC(FIRMWARE_REVISION, "1.0.1"),
HOMEKIT_CHARACTERISTIC(IDENTIFY, accessory_identify),
NULL
}),
HOMEKIT_SERVICE(LIGHTBULB, .primary=true,
.characteristics=(homekit_characteristic_t*[]){
HOMEKIT_CHARACTERISTIC(NAME, "Led"),
&led_on,
NULL
}),
NULL
}),
NULL
HOMEKIT_ACCESSORY(
.id = 2,
.category = homekit_accessory_category_lightbulb,
.services=(homekit_service_t*[]){
HOMEKIT_SERVICE(ACCESSORY_INFORMATION,
.characteristics=(homekit_characteristic_t*[]){
&name,
HOMEKIT_CHARACTERISTIC(MANUFACTURER, ACCESSORY_MANUFACTURER),
&serial_number,
HOMEKIT_CHARACTERISTIC(MODEL, ACCESSORY_MODEL),
HOMEKIT_CHARACTERISTIC(FIRMWARE_REVISION, "1.0.1"),
HOMEKIT_CHARACTERISTIC(IDENTIFY, accessory_identify),
NULL
}),
HOMEKIT_SERVICE(LIGHTBULB, .primary=true,
.characteristics=(homekit_characteristic_t*[]){
HOMEKIT_CHARACTERISTIC(NAME, "Led2"),
&led_on,
NULL
}),
NULL
}),
NULL
};
homekit_server_config_t config = {
.accessories = accessories,
.password = "813-55-297",
//.on_event = on_homekit_event,
.setupId = "ABCD"
};
void accessory_init() {
pinMode(PIN_LED, OUTPUT);
pinMode(PIN_LED2, OUTPUT);
led_set_power(false);
//Rename ACCESSORY_NAME base on MAC address.
uint8_t mac[6];
esp_wifi_get_mac(WIFI_IF_STA, mac);
sprintf(ACCESSORY_NAME, "ESP32_LED_%02X%02X%02X", mac[3], mac[4], mac[5]);
}

I think I can see a problem here:

how can i fix it ? do you have any suggestion ?

Do proper formatting and the problem will become obvious.

thank you @maximkulkin  first step ok now i can see 2 device on iphone screen but one of them say doesn't respons, and other switch control both pin. how can i seperate it ?
#include <Arduino.h>
#include <homekit/types.h>
#include <homekit/homekit.h>
#include <homekit/characteristics.h>
#include <stdio.h>
#include <port.h>
#include <esp_wifi_types.h>
#include <esp_wifi.h>
static char ACCESSORY_NAME[32] = "TT AKILLI EV SİSTEMİ";
#define ACCESSORY_SN  ("00001")  //SERIAL_NUMBER
#define ACCESSORY_MANUFACTURER ("Tarkan TAŞKIN")
#define ACCESSORY_MODEL  ("LED")
#define PIN_LED 2
#define ACCESSORY_MODEL  ("LED2")
#define PIN_LEDd 23
void led_set_power(bool on) {
digitalWrite(PIN_LED, on ? HIGH : LOW);
digitalWrite(PIN_LEDd, on ? HIGH : LOW);
}
void led_setter(homekit_value_t value);
homekit_characteristic_t name = HOMEKIT_CHARACTERISTIC_(NAME, ACCESSORY_NAME);
homekit_characteristic_t serial_number = HOMEKIT_CHARACTERISTIC_(SERIAL_NUMBER, ACCESSORY_SN);
homekit_characteristic_t led_on = HOMEKIT_CHARACTERISTIC_(ON, false, .setter=led_setter);
void led_setter(homekit_value_t value) {
if (value.format != homekit_format_bool) {
printf("Invalid on-value format: %d\n", value.format);
return;
}
const bool power = value.bool_value;
led_on.value.bool_value = power; // Sync the value, and no getter needed.
led_set_power(power);
printf("Set Builtin-LED to %s\n", power ? "ON" : "OFF");
}
void led_toggle() {
bool power = !led_on.value.bool_value;
led_on.value.bool_value = power;
led_set_power(power);
homekit_characteristic_notify(&led_on, led_on.value);
}
void led_blink_task(void *_args) {
for (int i = 0; i < 3; i++) {
led_set_power(true);
vTaskDelay(100 / portTICK_PERIOD_MS);
led_set_power(false);
vTaskDelay(100 / portTICK_PERIOD_MS);
}
led_set_power(false);
vTaskDelete(NULL);
}
void led_blink() {
xTaskCreate(led_blink_task, "led_blink_task", 2048, NULL, 1, NULL);
}
void accessory_identify(homekit_value_t _value) {
printf("accessory identify\n");
led_blink();
}
homekit_accessory_t accessories[] = {
HOMEKIT_ACCESSORY(
.id = 1,
.category = homekit_accessory_category_lightbulb,
.services=(homekit_service_t[]){
HOMEKIT_SERVICE(ACCESSORY_INFORMATION,
.characteristics=(homekit_characteristic_t*[]){
&name,
HOMEKIT_CHARACTERISTIC(MANUFACTURER, ACCESSORY_MANUFACTURER),
&serial_number,
HOMEKIT_CHARACTERISTIC(MODEL, ACCESSORY_MODEL),
HOMEKIT_CHARACTERISTIC(FIRMWARE_REVISION, "1.0.1"),
HOMEKIT_CHARACTERISTIC(IDENTIFY, accessory_identify),
NULL
}),
HOMEKIT_SERVICE(LIGHTBULB, .primary=true,
.characteristics=(homekit_characteristic_t*[]){
HOMEKIT_CHARACTERISTIC(NAME, "Led"),
&led_on,
NULL
}),
NULL
}),
HOMEKIT_ACCESSORY(
.id = 2,
.category = homekit_accessory_category_lightbulb,
.services=(homekit_service_t*[]){
HOMEKIT_SERVICE(ACCESSORY_INFORMATION,
.characteristics=(homekit_characteristic_t*[]){
&name,
HOMEKIT_CHARACTERISTIC(MANUFACTURER, ACCESSORY_MANUFACTURER),
&serial_number,
HOMEKIT_CHARACTERISTIC(MODEL, ACCESSORY_MODEL),
HOMEKIT_CHARACTERISTIC(FIRMWARE_REVISION, "1.0.1"),
HOMEKIT_CHARACTERISTIC(IDENTIFY, accessory_identify),
NULL
}),
HOMEKIT_SERVICE(LIGHTBULB, .primary=true,
.characteristics=(homekit_characteristic_t*[]){
HOMEKIT_CHARACTERISTIC(NAME, "Led"),
&led_on,
NULL
}),
NULL
}),
NULL
};

homekit_server_config_t config = {
.accessories = accessories,
.password = "813-55-297",
//.on_event = on_homekit_event,
.setupId = "ABCD"
};
void accessory_init() {
pinMode(PIN_LED, OUTPUT);
pinMode(PIN_LEDd, OUTPUT);

ok i did it finaly :)) and here it is .
1st link updated 2 component
2nd link original project
Arduino-HomeKit-ESP32-2 component updated.zip
Arduino-HomeKit-ESP32-master.zip

Hi, qq, for Led2 you have &led_on and for Led you have &led2_on,  is that right?
Sent from my iPhone 
Press in Dire Situations http://www.nooooooooooooooo.com/

On Jul 21, 2020, at 9:47 PM, ttaskin<EMAIL_ADDRESS>wrote:

ok i did it finaly :)) and here it is .
1st link updated 2 component
2nd link original project
Arduino-HomeKit-ESP32-2 component updated.zip
Arduino-HomeKit-ESP32-master.zip
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.

@royfocker19  really ? i don't see like thet situation, by the way im realllllyy level 0 at programing and esp :))
may you show my wrong at my code please.

ok ok i find it :) at the end of code, thank you for your attension

Verify your version with the following example:
‘’’
homekit_characteristic_t switch1_on = HOMEKIT_CHARACTERISTIC_(ON, false, .callback=HOMEKIT_CHARACTERISTIC_CALLBACK(switch1_on_callback));
homekit_characteristic_t switch2_on = HOMEKIT_CHARACTERISTIC_(ON, false, .callback=HOMEKIT_CHARACTERISTIC_CALLBACK(switch2_on_callback));
homekit_characteristic_t name = HOMEKIT_CHARACTERISTIC_(NAME, D_MODEL);
homekit_characteristic_t name1 = HOMEKIT_CHARACTERISTIC_(NAME, D_NAME1);
homekit_characteristic_t name2 = HOMEKIT_CHARACTERISTIC_(NAME, D_NAME2);
homekit_accessory_t accessories[] = {
HOMEKIT_ACCESSORY(.id=1, .category=homekit_accessory_category_switch, .services=(homekit_service_t[]){
HOMEKIT_SERVICE(ACCESSORY_INFORMATION, .characteristics=(homekit_characteristic_t*[]){
&name,
HOMEKIT_CHARACTERISTIC(MANUFACTURER, D_MANIFACTURER),
HOMEKIT_CHARACTERISTIC(SERIAL_NUMBER, D_SN),
HOMEKIT_CHARACTERISTIC(MODEL, D_MODEL),
HOMEKIT_CHARACTERISTIC(FIRMWARE_REVISION, D_FW),
HOMEKIT_CHARACTERISTIC(IDENTIFY, switch_identify),
NULL
}),
HOMEKIT_SERVICE(SWITCH, .primary=true, .characteristics=(homekit_characteristic_t*[]){
HOMEKIT_CHARACTERISTIC(NAME, D_NAME1),
&name1,
&switch1_on,
NULL
}),
NULL
}),
HOMEKIT_ACCESSORY(.id=2, .category=homekit_accessory_category_switch, .services=(homekit_service_t*[]){
HOMEKIT_SERVICE(ACCESSORY_INFORMATION, .characteristics=(homekit_characteristic_t*[]){
&name,
HOMEKIT_CHARACTERISTIC(MANUFACTURER, D_MANIFACTURER),
HOMEKIT_CHARACTERISTIC(SERIAL_NUMBER, D_SN),
HOMEKIT_CHARACTERISTIC(MODEL, D_MODEL),
HOMEKIT_CHARACTERISTIC(FIRMWARE_REVISION, D_FW),
HOMEKIT_CHARACTERISTIC(IDENTIFY, switch_identify),
NULL
}),
HOMEKIT_SERVICE(SWITCH, .primary=true, .characteristics=(homekit_characteristic_t*[]){
HOMEKIT_CHARACTERISTIC(NAME, D_NAME2),
&name2,
&switch2_on,
NULL
}),
NULL
}),
NULL
};
‘’’

Hello, I'm trying to use my esp with your homekit library in order to control two different devices, a fan and a light, both connected to one single esp.
When creating the accessories array, I add a second accessory with .id=2, and all its relative services and information.
The firmware compiles fine but when I try to add the two accessories to my home, I am only able to see the first one (with id 1). Moreover it fails to pair, menaing that as soon as the pairing setup is finished, the esp recives an unpair command from homekit and deletes the pairing, resulting in a pair error in home app.
What am I doing wrong?
Thank you!

Looks like there cannot be two HomeKit accessories in a home with the same ACCESSORY_INFORMATION service names.
If you have it that name hard coded you probably have to make it dynamic, unless you wanna change the source code for every piece of hardware added.
I added a client_name field to my captive page, put the value in a string, and point the corresponding homekit_characteristic_t to it, like so:
homekit_characteristic_t cha_name = HOMEKIT_CHARACTERISTIC_(NAME, "initial name");

later in my code, after the Wifi connection has been established, but before HomeKit initialization:
cha_name.value.string_value = client_name;

Maybe that helps.

Looks like there cannot be two HomeKit accessories in a home with the same ACCESSORY_INFORMATION service names.
If you have it that name hard coded you probably have to make it dynamic, unless you wanna change the source code for every piece of hardware added.
I added a client_name field to my captive page, put the value in a string, and point the corresponding homekit_characteristic_t to it, like so:
homekit_characteristic_t cha_name = HOMEKIT_CHARACTERISTIC_(NAME, "initial name");

and
homekit_accessory_t *accessories[] = {
    HOMEKIT_ACCESSORY(.id=1, .category=homekit_accessory_category_lightbulb, .services=.   (homekit_service_t*[])
		{
        HOMEKIT_SERVICE(ACCESSORY_INFORMATION, .characteristics=(homekit_characteristic_t*[])
				{
            &cha_name,
....

later in my code, after the Wifi connection has been established, but before HomeKit initialization:
cha_name.value.string_value = client_name;

Maybe that helps.

Good day!
could you please share the code, I can't make a dynamic name for the devices


Add support for odk:recordaudio

Closes #517
Why is this the best possible solution? Were any other approaches considered?
I'm not that familiar with the code base so would not be surprised if there's a better way of parsing the parameters than what I ended up with. Mostly just put this in following how other actions/questions were handled.
What are the regression risks?
Shouldn't be any really as most code refers to a new question type.
Before submitting this PR, please make sure you have:

[x] included test cases for core behavior and edge cases in tests_v1
[x] run nosetests and verified all tests pass
[x] run black pyxform to format code
[x] verified that any code or assets from external sources are properly credited in comments

Codecov Report

Merging #519 (80fc54e) into master (7e86931) will increase coverage by 0.06%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #519      +/-   ##
==========================================
+ Coverage   83.86%   83.92%   +0.06%
==========================================
  Files          25       25
  Lines        3699     3713      +14
  Branches      862      865       +3
==========================================
+ Hits         3102     3116      +14
  Misses        452      452
  Partials      145      145

Impacted Files
Coverage Δ

pyxform/question_type_dictionary.py
57.14% <ø> (ø)

pyxform/constants.py
100.00% <100.00%> (ø)

pyxform/xls2json.py
78.65% <100.00%> (+0.32%)
:arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7e86931...6a7b49d. Read the comment docs.

@MartijnR it occurs to me you might like (and it might be a good idea) to do a sanity check on this.

Thanks. I had a quick look at the tests. All looks good to me!


Support StaticResource in Bindings inside DataTemplate

This is an initial concept for resolving the issue of AmbientProvider inside DataTemplate not having access to parent AmbientProvider therefore not having access to Resources declared earlier.
This also involves changes done in Protable.Xaml, which also will need to be accepted in order to proceed with this request further.
This would fix #1464

Done

Oh, you say "initial concept" - why is that? Is there more left to do?

I've removed the "old" method, leaving just one with an optional parameter.
I've said it was an initial concept because I wasn't sure if that's the correct way, but I don't think there is any better. I think it's good to go now.


Please describe what exactly to do to run bleno and noble?

I could not understand how to install bleno and noble and work with them. I don't have rpi or arduino boards. I just have my Mac and nexus 6. How do I run these two apps using Mac and nexus. Forgive my naïvety. Thanks in advance. I have fair knowledge of NodeJS. Please let me know as soon as possible.

Closing, discussion continued on gitter.


Update server.py

A minor spelling error.

Found the spelling error while going through the documentation.

Thank you for contributing to openstack/heat!
openstack/heat uses Gerrit for code review.
If you have never contributed to OpenStack before make sure you have read the
getting started documentation:
http://docs.openstack.org/infra/manual/developers.html#getting-started
Otherwise please visit
http://docs.openstack.org/infra/manual/developers.html#development-workflow
and follow the instructions there to upload your change to Gerrit.


Reorder kata directories

Fixes #185 .
This PR is meant to be a basis for discussion following the conversation on #185. The rationale behind the numbering is explained in the commit message.
If and when the order is approved, we might add next/prev links in the README files.

I would have liked to separate the discussion of numeric prefixes from any talk of renaming the actual exercises.
I have commented on the numeric prefixes in the original issue #185 .
The renaming of exercises is an open discussion in #156 and also a more specific changes in #172
Finally a small comment on the renaming of the interactive rebase kata. I called it advanced because it is a very unguided free-form exercise, and I was planning on creating 1 or two more introductory exercises as well. Whether the "advanced" part should be moved to a postfix instead is another discussion (aka #156 again).

Hi @adamatan
Thank you for your contribution. I will reject and close this PR as the fix ended up being different: #189


Elapsed time stuck on 00:00

Elapsed time stuck on 00:00
EDIT: Seems like it's like that for my friend and not for me.

That's weird, because discord uses started time and calculate elapsed time.


the walk result dimension seems to be incorrect

Hi, @razrLeLe , I use your code to run an input graph which data is formated by edgelists, it looks like this:

1 176
1 233
1 283
1 371
1 394
1 446
1 585
1 645
1 667
1 696
...
I use command :./fastwalk --edge_list src/edges.txt --output edgestxt.out --walk_length=80 --num_walks=10 --workers=20 --max_nodes=50000 --max_edges=100000 --p=10 --q=0.01
As far as I know, the result dimension should be (V*num_walks)x(num_walks), V is the size of vertex.However, both the row and column of result I get are wrong, So, i don't understand the output mean

The result's shape should be (V*num_walks, walk_length), what's the shape you got?

The row should be 7115*10, the column should be 80, but i get 194749 * 2.
And, I find your vertex count is not correct,The vertex of my graph is 7115 , howerver, your code says 8491,I don't konw why. The edges number is correct.

Can you offer some data to debug?

The  link: https://pan.baidu.com/s/13Hua7ZtRVS_XC2YSMFQTrA ,and password: be5h

There are Windows newline symbols in your input data, which results in the incorrect output, I will add string trimming during loading graph in the future, before that please preprocess the input data yourself.
You can use sed to remove those symbol first:
cat edges.txt | sed -e 's/\r//' > edges_trimmed.txt
it shows that there are 10312 vertexes:
~/workspace/fastwalk(master*) » cat edges_trimmed.txt | awk '{printf("%s\n%s\n", $1, $2);}' | sort -u | wc -l

10312

and the program will output as expection:
~/workspace/fastwalk(master*) » ./fastwalk --edge_list edges_trimmed.txt --output edges_out.txt --delimiter space --p 10 --q 0.01 --max_nodes 50000 --max_edges 50000 --workers 4
[2021-02-06 13:38:45] Loading file: edges_trimmed.txt
[2021-02-06 13:38:45] Done reading edgelist files, starting to build graph...
[2021-02-06 13:38:46] Done building graph.
[2021-02-06 13:38:46] Graph node num: 10312 edge num: 333983
[2021-02-06 13:38:46] Graph loaded.
[2021-02-06 13:38:47] Starting to walk...
[2021-02-06 13:38:47] Done feeding nodes.
[2021-02-06 13:39:12] All done.

Notice that the input data is loaded as directed graph, which means there can be isolated vertex, the walk will stop when reached those vertexes, so each row may have columns less than walk_length.

OK,thanks.


Is it Possible to Block Publishing to Certain Clients

Hello,
My team and I are working with this library, and we are wondering if something along these lines is possible.
Say you have 3 clients set up to the same port and address.
Say these 3 clients are all subscribed to the topic "Test"
Say 1 client publishes a message to "Test"
Normally all 3 clients would receive this message with the typical message handler in place.
Is there a way so that the client that publishes the message does not receive the message despite being subscribed to the topic?
Thanks for any help!

I would say no, this is not possible (At least not easily). Can you use different topics maybe?
E.g.
client 1: /topic/identifier1
client 2: /topic/identifier2
client 3: /topic/identifier3
All clients could subscribe to /topic/+ and check whether their own identifier is used.
E.g. if client 1 publishes, it publishes to /topic/identifier1.
On client 1: Receives the message on /topic/+, checks whether the topic contains the own identifier (e.g. if(topic.Contains("identifier1")) --> It is contained, so we can return here as we are the sender.
On client 2: Receives the message on /topic/+, checks whether the topic contains the own identifier (e.g. topic.Contains("identifier2") --> It is not contained, so we can run some other action(s).
On client 3: Receives the message on /topic/+, checks whether the topic contains the own identifier (e.g. topic.Contains("identifier3") --> It is not contained, so we can run some other action(s).

I would say no, this is not possible (At least not easily). Can you use different topics maybe?
E.g.
client 1: /topic/identifier1
client 2: /topic/identifier2
client 3: /topic/identifier3
All clients could subscribe to /topic/+ and check whether their own identifier is used.
E.g. if client 1 publishes, it publishes to /topic/identifier1.
On client 1: Receives the message on /topic/+, checks whether the topic contains the own identifier (e.g. if(topic.Contains("identifier1")) --> It is contained, so we can return here as we are the sender.
On client 2: Receives the message on /topic/+, checks whether the topic contains the own identifier (e.g. topic.Contains("identifier2") --> It is not contained, so we can run some other action(s).
On client 3: Receives the message on /topic/+, checks whether the topic contains the own identifier (e.g. topic.Contains("identifier3") --> It is not contained, so we can run some other action(s).

That's a pretty simple to understand workaround. I'll probably end up using something like that. Thanks a lot.
I did also find something similar to what I described talked about in this thread https://github.com/chkr1011/MQTTnet/issues/300
@chkr1011 said that it was implemented in 2.8.0 but I wasn't able to find said implementation anywhere. I might have just been looking in the wrong places though

That's a pretty simple to understand workaround. I'll probably end up using something like that. Thanks a lot.
I did also find something similar to what I described talked about in this thread https://github.com/chkr1011/MQTTnet/issues/300
@chkr1011 said that it was implemented in 2.8.0 but I wasn't able to find said implementation anywhere. I might have just been looking in the wrong places though

That's a pretty simple to understand workaround. I'll probably end up using something like that. Thanks a lot.
I did also find something similar to what I described talked about in this thread #300
@chkr1011 said that it was implemented in 2.8.0 but I wasn't able to find said implementation anywhere. I might have just been looking in the wrong places though

I guess, that's this handler: https://github.com/chkr1011/MQTTnet/wiki/Server#intercepting-application-messages
Setting context.AcceptPublish = false;. The problem is that this will block the publishing at all (Meaning that none of your clients would get the message). Maybe, I've missed something that @chkr1011 can clear with this issue #300, I'm not sure.

That's a pretty simple to understand workaround. I'll probably end up using something like that. Thanks a lot.
I did also find something similar to what I described talked about in this thread #300
@chkr1011 said that it was implemented in 2.8.0 but I wasn't able to find said implementation anywhere. I might have just been looking in the wrong places though

I guess, that's this handler: https://github.com/chkr1011/MQTTnet/wiki/Server#intercepting-application-messages
Setting context.AcceptPublish = false;. The problem is that this will block the publishing at all (Meaning that none of your clients would get the message). Maybe, I've missed something that @chkr1011 can clear with this issue #300, I'm not sure.

@SeppPenner This correct 👍
I close this ticket because I assume it is no longer needed.

@SeppPenner This correct 👍
I close this ticket because I assume it is no longer needed.


documentation: add STUNner to the list of implementations

What type of PR is this?
/kind documentation
What this PR does / why we need it:
STUNner is a new implementation of the Gateway API that may be of interest to the wider audience of the Gateway API project. STUNner was presented and discussed at the 2023-01-30 community meeting.
Which issue(s) this PR fixes:
N/A
Does this PR introduce a user-facing change?:
No

I've added a note that requests and PRs should go to the STUNner team, not Gateway API. Also signed the CLA, happy to be a first-time contributor here...:-)


Is there any demo on Blazor ServerSide?

Thanks.

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: d0da2144-3730-f8ef-1d16-a89f11fd6198
Version Independent ID: 6d8f5bc8-8f5c-ba13-b7f2-0366eac46f81
Content: Authentication and authorization in ASP.NET Core SignalR
Content Source: aspnetcore/signalr/authn-and-authz.md
Product: aspnet-core
Technology: aspnetcore-signalr
GitHub Login: @bradygaster
Microsoft Alias: bradyg

I don't know of any plans for one.
AFAIK the sample should just work if you switch to Server-side Blazor.

I guess I should test then. If we can broaden the current topic out to a choice between the hosting models, that would be best ... take the least time and take the least coverage.
I'll let Artak give me the priority on this and then give it a shot and see how it goes. I'm going to change the metadata on this issue to reflect the current tutorial.

I guess I should test then.

Given the workload, I don't want to waste time (thus 💰) testing something that should work. There haven't been any new issues or further comment on this one, nor has management called for any action.
We'll keep an :ear: open for more feedback in this vein.


WindowsDefs.GetTickCount64 is missing

Hello, thanks for sharing the lib, when checking it out, i found that WindowsDefs.pas is missing from the repo. Thank!

I confirm it's compiable now


Add video about SQL queries with Polars

Link to suggestion
https://www.youtube.com/watch?v=-D_tsBY4NrI
Targeted section
Talks and videos
Describe your suggestion

Polars - SQL Interface for Querying DataFrames ⏳ 20 min - A video that
shows how to use SQL to query the data in Polars DataFrames by @bugbytes-io.

Checklist

[X] checked if your suggestion is not already listed in Awesome Polars list.
[X] checked if it can fit in an existed section or suggest a new section and explain why your item does not fit into one and what would be the interest of your new section.
[X] checked when it's a repository if it's maintained (archived repository will be rejected).

@bugbytes-io your video will be added to the Awesome Polars List

Thanks for sharing that, Damien!


Why pass a empty string to newFixedLengthResponse() when nanohttpd server a default main page file index.htm?

I use nanohttpd as web server in my android.
There is an index.htm file in my web folder, the nanohttpd will access the default main page file index.htm when I vistit my web server via http://<IP_ADDRESS>:8080/.
I found the system launch the code from line 544 to 548, but I'm very suprised that it pass a empty string to newFixedLengthResponse(Response.Status.NOT_MODIFIED, mime, "") and FireFox can display the correct content of index.htm
In my mind, it should pass the file index.htm to newFixedLengthResponse(Response.Status.NOT_MODIFIED, mime, "")!
line 544 to 548
               // full-file-fetch request
                // would return entire file
                // respond with not-modified
                res = newFixedLengthResponse(Response.Status.NOT_MODIFIED, mime, "");
                res.addHeader("ETag", etag);

AFAIK that NOT_MODIFIED means your browser already has the page in cache, in which case it first sends a HEAD request to NanoHTTPD instead of a GET, saying it has a version from a certain date.
NanoHTTPD responds with a NOT_MODIFIED meaning that the file has not been modified since the browser last cached it and therefore the browser doesn't need to request the full file again and can instead use the one it has in cache because it's the same version.


Implement new plugin interface metthods

Thank you for merging my PR @joachim-n, sorry I didn't test it as well as I hoped, we need to implement two new interface methods

This allowed it to work but the dev-master version looks like this now, so might need a bit more work:
-    ubccs/recipes: 'dev-master:882b05c4a9823b5d6915a8f4708ed60a6dbcfb47'
+    ubccs/recipes: '9999999-dev:2bcb71621c58464d913c0142ed625439a1a4128e'

Thanks for the quick update!
I'll merge this PR and make a bugfix release so that this critical is fixed. The problem with version numbers in the YAML can be a follow-up.
Thanks for your help with this, I appreciate it, especially as I'm not sure I have the mental capacity to dive into Composer 2 at the moment!

Thanks again @joachim-n I dug in so you don't have to;) Here's a follow-up: https://github.com/joachim-n/composer-manifest/pull/8


Cannot add a polygon field when this field is indexed with a lucene spatial engine

OrientDB Version:  3.08
Java Version:
OS: windows 10
Expected behavior
Vertex properly created
Actual behavior
com.orientechnologies.orient.core.index.OIndexException: Cannot create the index 'Agent.polygonLocation' DB name="test" --> java.lang.ClassCastException: java.lang.Float cannot be cast to java.util.List
Steps to reproduce
CREATE CLASS Agent EXTENDS V
CREATE PROPERTY Agent.polygonLocation EMBEDDED OPolygon;
CREATE INDEX Agent.polygonLocation ON Agent(polygonLocation) SPATIAL ENGINE LUCENE;
INSERT INTO Agent SET polygonLocation = {"@class":"OPolygon","coordinates":[[1.399657130241394,43.58523264988069],[1.400507390499115,43.58523264988069],[1.400507390499115,43.58608361522166],[1.399657130241394,43.58608361522166],[1.399657130241394,43.58523264988069]]}
Note that if the index is not created, then the vertex is created.
If the index is created after, the error appears when the index is created

Hi @BrunoSupiot
the syntax for creating polygons it's the same as GeoJSON
https://geojson.org/geojson-spec.html#polygon
So in your case with a Single Ring should be
INSERT INTO Agent SET polygonLocation = {"@Class":"OPolygon","coordinates":[[[1.399657130241394,43.58523264988069],[1.400507390499115,43.58523264988069],[1.400507390499115,43.58608361522166],[1.399657130241394,43.58608361522166],[1.399657130241394,43.58523264988069]]]}

Hi @BrunoSupiot
that is strange , work on my box with 3.0.9 and this script sequence
CREATE CLASS Agent EXTENDS V
CREATE PROPERTY Agent.polygonLocation EMBEDDED OPolygon;
CREATE INDEX Agent.polygonLocation ON Agent(polygonLocation) SPATIAL ENGINE LUCENE;
INSERT INTO Agent SET polygonLocation = {"@Class":"OPolygon","coordinates":[[[1.399657130241394,43.58523264988069],[1.400507390499115,43.58523264988069],[1.400507390499115,43.58608361522166],[1.399657130241394,43.58608361522166],[1.399657130241394,43.58523264988069]]]}

I just tried with 3.09 version of OrientDB, and it works!
So the bug was corrected (directly or indirectly) with the 3.09.
Thank you for your help
Bruno


Ignore imgui vcx.proj

Not a big deal, but can cause issues for inexperienced developers.
Steps:

clone hazel
Initialize submodules
3.run script to generate solution

Bug:
ImGui submodule detects changes in the working directory.

Proposed solution:

add file to .gitignore in imgui repository [this might need to fork the official repository, branch off the docking branch (i.e. hazel-master), commit changes in the submodule and then update hazel to point to the right imgui commit.

Aren't all the .vcxproj files already been ignored? https://github.com/TheCherno/Hazel/blob/eb3f705b6097d81d8c743d19ecb239d4dfb94c0c/.gitignore#L12
Seems to not pop up in my git bash as an unstaged file...

That only works for the hazel repo.
Sumbodules are different repositories, so it needs that in each repository.

Ah I see now, it is already in the GLFW gitignore, but this is not the case for ImGui, so that's why it is only showing up for ImGui. As you see above, I've made a PR to cherno's branch in order to add these to gitignore.

An alternative solution would be to change the premake script so that it generates "out of source" build files.
Then, the .vcxproj's dont end up spread around in the source tree, and you dont need to worry about .gitignore, or accidentally committing something in the submodule.
Could also set it up so that different invocations of the build script generate projects for different systems (vs2019, cmake, whatever) all nicely separate from each other.
something like this:
root folder
build      <-- premake script creates this.  add to .gitignore
vs2019   <-- premake script create this. contains files for VS2019 build
Hazel.sln
Hazel.vcxproj
Sandbox.vcxproj
Imgui.vcxproj
etc. etc.
  cmake    <-- or if you prefer, get premake to generate this
      <all the files required for cmake to build Hazel in here>

Hazel           <-- this and everything below in git and version controlled, just as now
Sandbox
scripts
win-GenProjects.bat

I see what you mean, that's what I usually see in cmake-based project generation and I think that would be a quite elegant solution.

It's already pushed to ImGui submodule, but we still can do this, in a seperate PR


State does not run exit after entering state a second time in Unity 5.6

I'm not sure if this is a result of this version of Unity, or what, but I've noticed an issue now that I did not have previously.
My states go as follows:
Main Menu -> Loading Level -> In Game -> Paused (then quit game) -> Main Menu
I'm trying to go to loading level again, but it's trying to do a safe transition from Main Menu. Any clue what could be the problem? Sorry, I know it's vague. Let me know if I need to provide more info

Uh, it's pretty hard to offer much advice based on that.
If you're quitting, are you loading a new scene? The statemachine is tied to the life cycle of a game object. So if your game object gets destroyed, so will the state machine? Otherwise it would help to know exactly where it's failing. Do you know how to use a debugger? Step through the code every time you call ChangeState, even if you don't quite understand what's going on in the StateMachine class, it should allow you to see whats different when it's not working as you expect.


Update information of LZ viewer at CSCS

The current version of LZ viewer available from the dataset cards, has old information under the question mark. I suggest to revise this text and include the link of the Readthedocs: https://localizoom.readthedocs.io <https://localizoom.readthedocs.io

Validated 17.02.2022


Check that plugin version update makes sense on presubmit

We had a few cases where plugin versions were erroneously went down(0.7.1+1 -> 0.6.1+2), or went up by more than one increment (0.1.1 -> 0.1.3).
This is even more likely when there's a merge conflict with another PR that updated the plugin.
Verifying that the version went up by a single increment as part of the presubmit checks can be a good safeguard.

Related to flutter/plugins#27258.

This got closed when i closed an earlier PR, not merge. ugh.


Allow to specify custom Swagger model name for serializers

This commit allows to specify "read" and "write" model names with serializer static field:
class MySerializer(serializers.ModelSerializer):
    __swagger_model_read_name = 'MyModel'
    __swagger_model_write_name = 'MyModelResponse'

This scheme was selected according to PEP 8 - Style Guide For Python Code:
__double_leading_underscore: when naming a class attribute, invokes name mangling (inside class FooBar, __boo becomes _FooBar__boo; see below).

needs a mention in the docs, and we'll be good to go.

Since this PR hasn't been merged yet: I'd like to be able to set this attribute in class Meta, because, well, it's meta-data and it makes for a more generalised solution that could be used outside django-rest-swagger as well.
Then the attribute name could be used. Like so:
class MySerializer(serializer):
(...)
class Meta:
   name = 'my request name'

I've made a fork that changes introspectors.get_serializer_name to achieve this.

+1 on this one also, would love to see it in soon. When using swagger-codegen, classes are created to represent each serializer - and 'FooSerializer' doesn't make a great deal of sense to the end user.

+1

Serializer names are no longer returned with v2.


[Issue]: ERROR: GraphXRTImpl::configureIfNotYet: xrtGraphOpen failed.

Is there an existing issue related to your problem?

[X] I have searched the existing issues

Lab
Vector Add 2
Section
"Implement for actual hardware"

Step
While executing "./host_ps_on_x86 a.xclbin", I am getting the error.

Description
Continuing from my previous ISSUE (https://github.com/Xilinx/xup_aie_training/issues/12), I am getting this error after modifying host.cpp file. After going through host.cpp file, I found that it is not using AIEngine when invoked to run on hardware. I added some changes (lines 98 to 109) as shown below :

    // Execute the compute units
 93     std::cout << "Run the kernels" << std::endl;
 94     auto run_pl_s2mm_1 = pl_s2mm_1(out_buff_1, nullptr, num_elements);
 95     auto run_pl_mm2s_1 = pl_mm2s_1(in_buff_1, nullptr, num_elements);
 96     auto run_pl_mm2s_2 = pl_mm2s_2(in_buff_2, nullptr, num_elements);
 97
 98 //////////////////////////////////////////
 99 // graph execution for AIE
100 //////////////////////////////////////////
101
102     std::cout << "graph init\n"<< std::endl;
103     vadd_graph.init();
104
105     std::cout << "graph run\n" << std::endl;
106     vadd_graph.run(1);
107
108     vadd_graph.end();
109     std::cout << "graph end\n" << std::endl;
110
111     // Wait for kernels to complete
112     run_pl_mm2s_1.wait();
113     std::cout << "pl_mm2s_1 completed" << std::endl;
114     run_pl_mm2s_2.wait();
115     std::cout << "pl_mm2s_2 completed" << std::endl;
116     run_pl_s2mm_1.wait();
117     std::cout << "pl_s2mm_1 completed" << std::endl;

And also #include "graph.cpp" in the begining of the file.
I have followed all the compilation steps to generate all necessary executable files.
I am getting below error :
./host_ps_on_x86 a.xclbin
Initializing ADF API...
Open the device
Load the xclbin a.xclbin
Get references to compute units
Allocate Buffer in Global Memory
Synchronize input buffers data to device global memory
Run the kernels
graph init
XRT build version: 2.14.384
Build hash: 090bb050d570d2b668477c3bd0f979dc3a34b9db
Build date: 2022-12-09 00:55:08
Git branch: 2022.2
PID: 299684
UID: 1105
[Tue Oct 10 10:18:17 2023 GMT]
HOST: hacc-vck5000-5
EXE: /home/spurini/soumitra/Vitis-Tutorials/AI_Engine_Development/Design_Tutorials/vadd_lab_hw/host_ps_on_x86
[XRT] ERROR: No such handle: Invalid argument
ERROR: GraphXRTImpl::configureIfNotYet: xrtGraphOpen failed.
GraphXRTImpl::configureIfNotYet: Couldn't find any configuration for graph id 0
ERROR: adf::graph::init: Failed to configure graph.
graph run
[XRT] ERROR: No such handle: Invalid argument
ERROR: GraphXRTImpl::configureIfNotYet: xrtGraphOpen failed.
GraphXRTImpl::configureIfNotYet: Couldn't find any configuration for graph id 0
ERROR: adf::graph::run: Failed to configure graph.
[XRT] ERROR: No such handle: Invalid argument
ERROR: GraphXRTImpl::configureIfNotYet: xrtGraphOpen failed.
GraphXRTImpl::configureIfNotYet: Couldn't find any configuration for graph id 0
ERROR: adf::graph::end: Failed to configure graph.
graph end
pl_mm2s_1 completed
pl_mm2s_2 completed
pl_s2mm_1 completed
Synchronize the output buffer data from the device
TEST PASSED with 1024 elements

### Instance

```markdown
same as mentioned in "https://github.com/Xilinx/xup_aie_training/issues/12"

Vitis
same as mentioned in "https://github.com/Xilinx/xup_aie_training/issues/12"

XRT
same as mentioned in "https://github.com/Xilinx/xup_aie_training/issues/12"

Platform
same as mentioned in "https://github.com/Xilinx/xup_aie_training/issues/12"

Linux distribution
same as mentioned in "https://github.com/Xilinx/xup_aie_training/issues/12"

Anything else?
I have also made changes in "graph.cpp" as suggested in "https://support.xilinx.com/s/question/0D54U000071JJKPSA4/graphxrtimplconfigureifnotyet-couldnt-find-any-configuration-for-graph-id-0error-adfgraphinit-failed-to-configure-graph?language=en_US" but it fails while compiling "host.cpp" with error : multiple declarations of main(), one in graph.cpp and another in host.cpp.
Please reply if any additional info is needed. Thanks.

Hi @soumitraghosh388,
In the VCK5000 the AIE graph cannot be controlled from the x86 code.
Please watch the End-to-End Development Flow with the VCK5000 here https://www.xilinx.com/products/boards-and-kits/vck5000.html#ai-engine

If you have access to the VCK5000 Versal Development Card Secure Site, you will be able to see a tutorial for PS Kernel Usage. This is the way to control the AIE graph, but it is not supported on this repository.


Inclusion into nvim-treesitter

Hey @ganezdragon ,
Do you know when you might PR this into the main nvim-treesitter repo? Would be cool to have perl support out of the box instead of having to clone and build and configure manually.
lua/nvim-treesitter/parsers.lua

Hi, I am also using this with My neovim on trial. I added my highlight .scm here -> https://github.com/lcrownover/nvim-treesitter/pull/1


Rebuild for the latest framecpp

This PR rebuilds this feedstock against the latest version of ldas-tools-framecpp.

Checklist

[x] Used a personal fork of the feedstock to propose changes
[x] Bumped the build number (if the version is unchanged)
[x] Reset the build number to 0 (if the version changed)
[x] Re-rendered with the latest conda-smithy (Use the phrase @conda-forge-admin, please rerender in a comment in this PR for automated rerendering)
[x] Ensured the license file is being packaged.

Hi! This is the friendly automated conda-forge-linting service.
I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.