# \[Solved\] Not allowed to publish to losant//state

**URL:** <https://forums.losant.com/t/solved-not-allowed-to-publish-to-losant-state/278>\
**Category:** Help\
**Created:** [October 27, 2016, 7:14pm UTC](https://forums.losant.com/t/solved-not-allowed-to-publish-to-losant-state/278 "2016-10-27T19:14:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ADRIAN\_ALBERTO\_AVINA](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@ADRIAN\_ALBERTO\_AVINA](https://forums.losant.com/u/ADRIAN_ALBERTO_AVINA)\
**Post date:** [October 27, 2016, 7:14pm UTC](https://forums.losant.com/t/solved-not-allowed-to-publish-to-losant-state/278/1 "2016-10-27T19:14:21Z")

</div>

Hi, I´m new with Losant, just tying my very first device. I am getting the following error while publishing from my device:  
Not allowed to publish to losant//state  
and I get the device disconnected.

What is that I am missing ?

---

<div class="post-metadata">

**Author:** ![Brandon\_Cannaday](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/brandon_cannaday/32/14_2.png) [@Brandon\_Cannaday](https://forums.losant.com/u/Brandon_Cannaday)\
**Post date:** [October 27, 2016, 10:57pm UTC](https://forums.losant.com/t/solved-not-allowed-to-publish-to-losant-state/278/2 "2016-10-27T22:57:22Z")

</div>

Are you seeing the error in the application communication log? What device are you trying to connect? Can you share the code you’re using?

---

<div class="post-metadata">

**Author:** ![ADRIAN\_ALBERTO\_AVINA](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@ADRIAN\_ALBERTO\_AVINA](https://forums.losant.com/u/ADRIAN_ALBERTO_AVINA)\
**Post date:** [October 28, 2016, 1:04am UTC](https://forums.losant.com/t/solved-not-allowed-to-publish-to-losant-state/278/3 "2016-10-28T01:04:08Z")

</div>

Thanks Brandon, I manage to fix this. I am using an ESP8266 Dev board, and in my code the LOSANT\_DEVICE\_ID constant was not set correct. Now is working.

---

<div class="post-metadata">

**Author:** ![Brandon\_Cannaday](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/brandon_cannaday/32/14_2.png) [@Brandon\_Cannaday](https://forums.losant.com/u/Brandon_Cannaday)\
**Post date:** [October 28, 2016, 5:48pm UTC](https://forums.losant.com/t/solved-not-allowed-to-publish-to-losant-state/278/4 "2016-10-28T17:48:51Z")

</div>

Glad you got it working!
